| .. | .. |
|---|
| 33 | 33 | |
|---|
| 34 | 34 | return single_open(file, show, NULL); |
|---|
| 35 | 35 | } |
|---|
| 36 | +static int kfd_debugfs_hang_hws_read(struct seq_file *m, void *data) |
|---|
| 37 | +{ |
|---|
| 38 | + seq_printf(m, "echo gpu_id > hang_hws\n"); |
|---|
| 39 | + return 0; |
|---|
| 40 | +} |
|---|
| 36 | 41 | |
|---|
| 37 | 42 | static ssize_t kfd_debugfs_hang_hws_write(struct file *file, |
|---|
| 38 | 43 | const char __user *user_buf, size_t size, loff_t *ppos) |
|---|
| .. | .. |
|---|
| 85 | 90 | |
|---|
| 86 | 91 | void kfd_debugfs_init(void) |
|---|
| 87 | 92 | { |
|---|
| 88 | | - struct dentry *ent; |
|---|
| 89 | | - |
|---|
| 90 | 93 | debugfs_root = debugfs_create_dir("kfd", NULL); |
|---|
| 91 | | - if (!debugfs_root || debugfs_root == ERR_PTR(-ENODEV)) { |
|---|
| 92 | | - pr_warn("Failed to create kfd debugfs dir\n"); |
|---|
| 93 | | - return; |
|---|
| 94 | | - } |
|---|
| 95 | 94 | |
|---|
| 96 | | - ent = debugfs_create_file("mqds", S_IFREG | 0444, debugfs_root, |
|---|
| 97 | | - kfd_debugfs_mqds_by_process, |
|---|
| 98 | | - &kfd_debugfs_fops); |
|---|
| 99 | | - if (!ent) |
|---|
| 100 | | - pr_warn("Failed to create mqds in kfd debugfs\n"); |
|---|
| 101 | | - |
|---|
| 102 | | - ent = debugfs_create_file("hqds", S_IFREG | 0444, debugfs_root, |
|---|
| 103 | | - kfd_debugfs_hqds_by_device, |
|---|
| 104 | | - &kfd_debugfs_fops); |
|---|
| 105 | | - if (!ent) |
|---|
| 106 | | - pr_warn("Failed to create hqds in kfd debugfs\n"); |
|---|
| 107 | | - |
|---|
| 108 | | - ent = debugfs_create_file("rls", S_IFREG | 0444, debugfs_root, |
|---|
| 109 | | - kfd_debugfs_rls_by_device, |
|---|
| 110 | | - &kfd_debugfs_fops); |
|---|
| 111 | | - |
|---|
| 112 | | - ent = debugfs_create_file("hang_hws", S_IFREG | 0644, debugfs_root, |
|---|
| 113 | | - NULL, |
|---|
| 114 | | - &kfd_debugfs_hang_hws_fops); |
|---|
| 115 | | - |
|---|
| 116 | | - if (!ent) |
|---|
| 117 | | - pr_warn("Failed to create rls in kfd debugfs\n"); |
|---|
| 95 | + debugfs_create_file("mqds", S_IFREG | 0444, debugfs_root, |
|---|
| 96 | + kfd_debugfs_mqds_by_process, &kfd_debugfs_fops); |
|---|
| 97 | + debugfs_create_file("hqds", S_IFREG | 0444, debugfs_root, |
|---|
| 98 | + kfd_debugfs_hqds_by_device, &kfd_debugfs_fops); |
|---|
| 99 | + debugfs_create_file("rls", S_IFREG | 0444, debugfs_root, |
|---|
| 100 | + kfd_debugfs_rls_by_device, &kfd_debugfs_fops); |
|---|
| 101 | + debugfs_create_file("hang_hws", S_IFREG | 0200, debugfs_root, |
|---|
| 102 | + kfd_debugfs_hang_hws_read, &kfd_debugfs_hang_hws_fops); |
|---|
| 118 | 103 | } |
|---|
| 119 | 104 | |
|---|
| 120 | 105 | void kfd_debugfs_fini(void) |
|---|