prof_main.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. #define DEBUG 1
  2. #include <linux/slab.h>
  3. #include <linux/proc_fs.h>
  4. #include <linux/sched.h>
  5. #include <linux/kallsyms.h>
  6. #include <linux/utsname.h>
  7. #include <asm/uaccess.h>
  8. #include <linux/sched.h>
  9. #include <linux/delay.h>
  10. #include <linux/pid.h>
  11. #include "internal.h"
  12. #include "mt_cputime.h"
  13. static void print_task(struct seq_file *m, struct task_struct *p)
  14. {
  15. SEQ_printf(m, "%15s %5d %9Ld %5d ",
  16. p->comm, p->pid, (long long)(p->nvcsw + p->nivcsw), p->prio);
  17. #ifdef CONFIG_SCHEDSTATS
  18. SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld\n",
  19. nsec_high(p->se.vruntime), nsec_low(p->se.vruntime),
  20. nsec_high(p->se.sum_exec_runtime),
  21. nsec_low(p->se.sum_exec_runtime),
  22. nsec_high(p->se.statistics.sum_sleep_runtime),
  23. nsec_low(p->se.statistics.sum_sleep_runtime));
  24. #else
  25. SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld\n",
  26. 0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
  27. #endif
  28. }
  29. /*========================================================================*/
  30. /* Real work */
  31. /*========================================================================*/
  32. /* 1. sched info */
  33. MT_DEBUG_ENTRY(sched_debug);
  34. static int mt_sched_debug_show(struct seq_file *m, void *v)
  35. {
  36. struct task_struct *g, *p;
  37. unsigned long flags;
  38. SEQ_printf(m, "=== mt Scheduler Profiling ===\n");
  39. SEQ_printf(m, "\nrunnable tasks:\n");
  40. SEQ_printf(m, " task PID switches prio");
  41. SEQ_printf(m, " exec-runtime sum-exec sum-sleep\n");
  42. SEQ_printf(m, "------------------------------------------------------");
  43. SEQ_printf(m, "----------------------------------------------------\n");
  44. read_lock_irqsave(&tasklist_lock, flags);
  45. do_each_thread(g, p) {
  46. print_task(m, p);
  47. } while_each_thread(g, p);
  48. read_unlock_irqrestore(&tasklist_lock, flags);
  49. return 0;
  50. }
  51. static ssize_t mt_sched_debug_write(struct file *filp,
  52. const char *ubuf, size_t cnt, loff_t *data)
  53. {
  54. return cnt;
  55. }
  56. #ifdef CONFIG_MTPROF_CPUTIME
  57. /* 2. cputime */
  58. MT_DEBUG_ENTRY(cputime);
  59. static int mt_cputime_show(struct seq_file *m, void *v)
  60. {
  61. struct mt_proc_struct *mtproc = mt_proc_head;
  62. int i = 0;
  63. unsigned long long end_ts;
  64. unsigned long long total_excul_time = 0, thread_time = 0;
  65. unsigned long long cost_isr_time = 0;
  66. unsigned long long cpu_idle_time[mt_cpu_num];
  67. u32 div_value;
  68. struct task_struct *tsk;
  69. struct task_struct *idle;
  70. struct mtk_isr_info *mtk_isr = NULL;
  71. char status;
  72. if (mt_proc_head == NULL) {
  73. SEQ_printf(m, "Please enable cputime again!\n");
  74. } else {
  75. if (0 == prof_end_ts || mtsched_is_enabled())
  76. end_ts = sched_clock();
  77. else
  78. end_ts = prof_end_ts;
  79. prof_dur_ts = end_ts - prof_start_ts;
  80. for (i = 0; i < mt_cpu_num; i++) {
  81. if (mtsched_is_enabled() ||
  82. (0 == mt_cpu_info_head[i].cpu_idletime_end)) {
  83. mt_cpu_info_head[i].cpu_idletime_end =
  84. mtprof_get_cpu_idle(i);
  85. if (mt_cpu_info_head[i].cpu_idletime_end <
  86. mt_cpu_info_head[i].cpu_idletime_start) {
  87. mt_cpu_info_head[i].cpu_idletime_end =
  88. mt_cpu_info_head[i].cpu_idletime_start;
  89. }
  90. }
  91. cpu_idle_time[i] =
  92. mt_cpu_info_head[i].cpu_idletime_end -
  93. mt_cpu_info_head[i].cpu_idletime_start;
  94. if (cpu_idle_time[i] * 1000 > prof_dur_ts) {
  95. cpu_idle_time[i] = prof_dur_ts;
  96. do_div(cpu_idle_time[i], 1000);
  97. }
  98. if (mtsched_is_enabled() ||
  99. (0 == mt_cpu_info_head[i].cpu_iowait_end)) {
  100. mt_cpu_info_head[i].cpu_iowait_end =
  101. mtprof_get_cpu_iowait(i);
  102. if (mt_cpu_info_head[i].cpu_iowait_end <
  103. mt_cpu_info_head[i].cpu_iowait_start) {
  104. mt_cpu_info_head[i].cpu_iowait_end =
  105. mt_cpu_info_head[i].cpu_iowait_start;
  106. }
  107. }
  108. }
  109. SEQ_printf(m, "iowait time(us): %llu",
  110. mt_cpu_info_head[0].cpu_iowait_end -
  111. mt_cpu_info_head[0].cpu_iowait_start);
  112. for (i = 1; i < mt_cpu_num; i++) {
  113. SEQ_printf(m, " , %llu",
  114. mt_cpu_info_head[i].cpu_iowait_end -
  115. mt_cpu_info_head[i].cpu_iowait_start);
  116. }
  117. SEQ_printf(m, "\n");
  118. SEQ_printf(m, "-----------------------------------------------\n");
  119. SEQ_printf(m, " Duration: %10Ld.%06ld ms\n",
  120. nsec_high(end_ts - prof_start_ts), nsec_low(end_ts - prof_start_ts));
  121. SEQ_printf(m, " --------------------------------\n");
  122. SEQ_printf(m, " Start: %10Ld.%06ld ms\n", nsec_high(prof_start_ts), nsec_low(prof_start_ts));
  123. SEQ_printf(m, " End: %10Ld.%06ld ms\n", nsec_high(end_ts), nsec_low(end_ts));
  124. SEQ_printf(m, "-----------------------------------------------\n");
  125. SEQ_printf(m,
  126. " Process:Status: PID: TGID: CPUtime: Percenta%%: Elapsed: User: Kernel: ISR type: ISRTime:\n");
  127. do_div(prof_dur_ts, 1000); /* change to us */
  128. for (i = 0; i < mt_cpu_num; i++) {
  129. thread_time = cpu_idle_time[i] * 1000000;
  130. do_div(thread_time, prof_dur_ts);
  131. div_value = (u32) thread_time;
  132. idle = idle_task(i);
  133. SEQ_printf(m,
  134. " Idle-%1d: L:%6d: 0:%10Ld.%03ld000:%10d.%04d%%:%10Ld.%06ld: 0: 0:%7d:%10Ld.%06ld:\n",
  135. i, 0 - i, usec_high(cpu_idle_time[i]), usec_low(cpu_idle_time[i]), div_value / 10000,
  136. div_value % 10000, nsec_high(end_ts - prof_start_ts),
  137. nsec_low(end_ts - prof_start_ts),
  138. idle->se.mtk_isr_count, nsec_high(idle->se.mtk_isr_time),
  139. nsec_low(idle->se.mtk_isr_time)
  140. );
  141. total_excul_time += (cpu_idle_time[i]) * 1000;
  142. }
  143. while (mtproc != NULL) {
  144. /* Record new cputime */
  145. tsk = find_task_by_vpid(mtproc->pid);
  146. if (tsk != NULL) {
  147. /* update cputime */
  148. if (mtsched_is_enabled()) {
  149. mtproc->cputime = tsk->se.sum_exec_runtime; /* - tsk->se.mtk_isr_time; */
  150. mtproc->isr_time = tsk->se.mtk_isr_time;
  151. mt_task_times(tsk, &mtproc->utime, &mtproc->stime);
  152. mtproc->utime =
  153. mtproc->utime - mtproc->utime_init;
  154. mtproc->stime =
  155. mtproc->stime - mtproc->stime_init;
  156. cost_isr_time =
  157. mtproc->isr_time - mtproc->isr_time_init;
  158. }
  159. status = 'L';
  160. } else {
  161. status = 'D';
  162. }
  163. if (mtsched_is_enabled()) {
  164. if (mtproc->cputime >=
  165. (mtproc->cputime_init + cost_isr_time)) {
  166. thread_time =
  167. mtproc->cputime - cost_isr_time -
  168. mtproc->cputime_init;
  169. mtproc->cost_cputime = thread_time;
  170. do_div(thread_time, prof_dur_ts);
  171. mtproc->cputime_percen_6 = thread_time;
  172. } else {
  173. mtproc->cost_cputime = 0;
  174. mtproc->cputime_percen_6 = 0;
  175. }
  176. }
  177. total_excul_time += (mtproc->cputime - mtproc->cputime_init);
  178. SEQ_printf(m,
  179. "%16s: %c:%6d:%6d:%10Ld.%06ld:%10d.%04d%%:%10Ld.%06ld:%7u:%7u:%7d:%10Ld.%06ld:\n",
  180. mtproc->comm, status, mtproc->pid, mtproc->tgid,
  181. nsec_high(mtproc->cost_cputime),
  182. nsec_low(mtproc->cost_cputime),
  183. mtproc->cputime_percen_6 / 10000,
  184. mtproc->cputime_percen_6 % 10000,
  185. nsec_high(mtproc->prof_end ==
  186. 0 ? end_ts - mtproc->prof_start : mtproc->prof_end -
  187. mtproc->prof_start),
  188. nsec_low(mtproc->prof_end ==
  189. 0 ? end_ts - mtproc->prof_start : mtproc->prof_end -
  190. mtproc->prof_start),
  191. jiffies_to_msecs(mtproc->utime),
  192. jiffies_to_msecs(mtproc->stime), mtproc->isr_count,
  193. nsec_high(cost_isr_time),
  194. nsec_low(cost_isr_time));
  195. mtproc = mtproc->next;
  196. }
  197. SEQ_printf(m, "********************\n");
  198. for (i = 0; i < mt_cpu_num; i++) {
  199. idle = idle_task(i);
  200. mtk_isr = idle->se.mtk_isr;
  201. if (idle->se.mtk_isr_count != 0) {
  202. SEQ_printf(m,
  203. "thread name: idle-%1d, thread id: 0, total ISR type %d:\n",
  204. i, idle->se.mtk_isr_count);
  205. }
  206. while (mtk_isr != NULL) {
  207. SEQ_printf(m,
  208. "ISR name: %16s: number: %d: count: %d: total time: %10Ld.%06ld:\n",
  209. mtk_isr->isr_name, mtk_isr->isr_num, mtk_isr->isr_count,
  210. nsec_high(mtk_isr->isr_time),
  211. nsec_low(mtk_isr->isr_time));
  212. mtk_isr = mtk_isr->next;
  213. }
  214. }
  215. mtproc = mt_proc_head;
  216. while (mtproc != NULL) {
  217. mtk_isr = mtproc->mtk_isr;
  218. if (mtproc->isr_count != 0) {
  219. SEQ_printf(m,
  220. "thread name: %16s, thread id: %d, total ISR type %d:\n",
  221. mtproc->comm, mtproc->pid, mtproc->isr_count);
  222. }
  223. while (mtk_isr != NULL) {
  224. SEQ_printf(m,
  225. "ISR name: %16s: number: %d: count: %d: total time: %10Ld.%06ld:\n",
  226. mtk_isr->isr_name, mtk_isr->isr_num, mtk_isr->isr_count,
  227. nsec_high(mtk_isr->isr_time),
  228. nsec_low(mtk_isr->isr_time));
  229. mtk_isr = mtk_isr->next;
  230. }
  231. mtproc = mtproc->next;
  232. }
  233. SEQ_printf(m, "********************\n");
  234. SEQ_printf(m, "All the thread total execult time is:%10Ld.%06ld.\n",
  235. nsec_high(total_excul_time),
  236. nsec_low(total_excul_time));
  237. }
  238. return 0;
  239. }
  240. static ssize_t mt_cputime_write(struct file *filp, const char *ubuf, size_t cnt, loff_t *data)
  241. {
  242. char buf[64];
  243. unsigned long val;
  244. int ret;
  245. if (cnt >= sizeof(buf))
  246. return -EINVAL;
  247. if (copy_from_user(&buf, ubuf, cnt))
  248. return -EFAULT;
  249. buf[cnt] = 0;
  250. ret = kstrtoul(buf, 10, &val);
  251. if (ret < 0)
  252. return ret;
  253. val = !!val;
  254. /* 0: off, 1:on */
  255. mt_cputime_switch(val);
  256. return cnt;
  257. }
  258. #endif
  259. #ifdef CONFIG_MT_ENG_BUILD
  260. MT_DEBUG_ENTRY(log);
  261. static unsigned long print_num;
  262. static unsigned long long second = 1;
  263. static int mt_log_show(struct seq_file *m, void *v)
  264. {
  265. SEQ_printf(m, "Print %ld lines log in %lld second in last time.\n", print_num, second);
  266. SEQ_printf(m, "show: Please echo m n > log again. m: second, n: level.\n");
  267. return 0;
  268. }
  269. static ssize_t mt_log_write(struct file *filp, const char *ubuf, size_t cnt, loff_t *data)
  270. {
  271. char buf[64];
  272. unsigned long long t1 = 0, t2 = 0;
  273. int level = 0;
  274. if (cnt >= sizeof(buf))
  275. return -EINVAL;
  276. if (copy_from_user(&buf, ubuf, cnt))
  277. return -EFAULT;
  278. buf[cnt] = 0;
  279. if (sscanf(buf, "%lld %d ", &second, &level) == 2) {
  280. SEQ_printf(NULL, "will print log in level %d about %lld second.\n", level, second);
  281. } else {
  282. SEQ_printf(NULL, "Please echo m n > log; m: second, n: level.\n");
  283. return cnt;
  284. }
  285. t1 = sched_clock();
  286. pr_err("printk debug log: start time: %lld.\n", t1);
  287. print_num = 0;
  288. for (;;) {
  289. t2 = sched_clock();
  290. if (t2 - t1 > second * 1000000000)
  291. break;
  292. pr_err("printk debug log: the %ld line, time: %lld.\n", print_num++, t2);
  293. switch (level) {
  294. case 0:
  295. break;
  296. case 1:
  297. __delay(1);
  298. break;
  299. case 2:
  300. __delay(5);
  301. break;
  302. case 3:
  303. __delay(10);
  304. break;
  305. case 4:
  306. __delay(50);
  307. break;
  308. case 5:
  309. __delay(100);
  310. break;
  311. case 6:
  312. __delay(200);
  313. break;
  314. case 7:
  315. __delay(500);
  316. break;
  317. case 8:
  318. __delay(1000);
  319. break;
  320. case 9:
  321. msleep(20);
  322. break;
  323. default:
  324. msleep(20);
  325. break;
  326. }
  327. }
  328. pr_err("mt log total write %ld line in %lld second.\n", print_num, second);
  329. return cnt;
  330. }
  331. #endif
  332. /* 6. reboot pid*/
  333. MT_DEBUG_ENTRY(pid);
  334. int reboot_pid = 0;
  335. static int mt_pid_show(struct seq_file *m, void *v)
  336. {
  337. SEQ_printf(m, "reboot pid %d.\n", reboot_pid);
  338. return 0;
  339. }
  340. static ssize_t mt_pid_write(struct file *filp, const char *ubuf,
  341. size_t cnt, loff_t *data)
  342. {
  343. char buf[10];
  344. unsigned long val;
  345. int ret;
  346. struct task_struct *tsk;
  347. if (cnt >= sizeof(buf)) {
  348. pr_debug("mt_pid input stream size to large.\n");
  349. return -EINVAL;
  350. }
  351. if (copy_from_user(&buf, ubuf, cnt))
  352. return -EFAULT;
  353. buf[cnt] = 0;
  354. ret = kstrtoul(buf, 10, &val);
  355. reboot_pid = val;
  356. if (reboot_pid > PID_MAX_DEFAULT) {
  357. pr_debug("get reboot pid error %d.\n", reboot_pid);
  358. reboot_pid = 0;
  359. return -EFAULT;
  360. }
  361. pr_debug("get reboot pid: %d.\n", reboot_pid);
  362. if (reboot_pid > 1) {
  363. tsk = find_task_by_vpid(reboot_pid);
  364. if (tsk != NULL)
  365. pr_crit("Reboot Process(%s:%d).\n", tsk->comm, tsk->pid);
  366. }
  367. return cnt;
  368. }
  369. #include <linux/signal.h>
  370. #include <trace/events/signal.h>
  371. #define STORE_SIGINFO(_errno, _code, info) \
  372. do { \
  373. if (info == SEND_SIG_NOINFO || \
  374. info == SEND_SIG_FORCED) { \
  375. _errno = 0; \
  376. _code = SI_USER; \
  377. } else if (info == SEND_SIG_PRIV) { \
  378. _errno = 0; \
  379. _code = SI_KERNEL; \
  380. } else { \
  381. _errno = info->si_errno; \
  382. _code = info->si_code; \
  383. } \
  384. } while (0)
  385. static const char * const signal_deliver_results[] = {
  386. "delivered",
  387. "ignored",
  388. "already_pending",
  389. "overflow_fail",
  390. "lost_info",
  391. };
  392. /* 7. signal logs */
  393. MT_DEBUG_ENTRY(signal_log);
  394. enum {
  395. SI_GENERATE = (1 << 0),
  396. SI_DELIVER = (1 << 1),
  397. } SI_LOG_MASK;
  398. static const char stat_nam[] = TASK_STATE_TO_CHAR_STR;
  399. static unsigned int enabled_signal_log;
  400. static void probe_signal_generate(void *ignore, int sig, struct siginfo *info,
  401. struct task_struct *task, int group, int result)
  402. {
  403. unsigned state = task->state ? __ffs(task->state) + 1 : 0;
  404. int errno, code;
  405. /*
  406. * only log delivered signals
  407. */
  408. if (result == TRACE_SIGNAL_DELIVERED) {
  409. STORE_SIGINFO(errno, code, info);
  410. pr_debug("[signal][%d:%s]generate sig %d to [%d:%s:%c] errno=%d code=%d grp=%d res=%s\n",
  411. current->pid, current->comm, sig,
  412. task->pid, task->comm,
  413. state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?',
  414. errno, code, group, signal_deliver_results[result]);
  415. }
  416. }
  417. static void probe_signal_deliver(void *ignore, int sig, struct siginfo *info,
  418. struct k_sigaction *ka)
  419. {
  420. int errno, code;
  421. STORE_SIGINFO(errno, code, info);
  422. pr_debug("[signal]sig %d delivered to [%d:%s] errno=%d code=%d sa_handler=%lx sa_flags=%lx\n",
  423. sig, current->pid, current->comm, errno, code,
  424. (unsigned long)ka->sa.sa_handler, ka->sa.sa_flags);
  425. }
  426. static void probe_death_signal(void *ignore, int sig, struct siginfo *info,
  427. struct k_sigaction *ka)
  428. {
  429. struct signal_struct *signal = current->signal;
  430. unsigned int state;
  431. /*
  432. * all action will cause process coredump or terminate
  433. */
  434. if ((sig_fatal(current, sig) || sig >= SIGRTMIN) &&
  435. (ka->sa.sa_handler == SIG_DFL) &&
  436. (!(signal->flags & SIGNAL_UNKILLABLE) || sig_kernel_only(sig))) {
  437. /*
  438. * verbose log for death signals
  439. * ignore SIGKILL because it's too much
  440. */
  441. if (sig != SIGKILL) {
  442. state = current->state ? __ffs(current->state) + 1 : 0;
  443. pr_debug("[signal]death sig %d delivered to [%d:%s:%c]\n",
  444. sig, current->pid, current->comm,
  445. state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
  446. }
  447. }
  448. }
  449. static int mt_signal_log_show(struct seq_file *m, void *v)
  450. {
  451. SEQ_printf(m, "%d: debug message for signal being generated\n", SI_GENERATE);
  452. SEQ_printf(m, "%d: debug message for signal being delivered\n", SI_DELIVER);
  453. SEQ_printf(m, "%d: enable all logs\n", SI_GENERATE | SI_DELIVER);
  454. SEQ_printf(m, "%d\n", enabled_signal_log);
  455. return 0;
  456. }
  457. static ssize_t mt_signal_log_write(struct file *filp, const char *ubuf,
  458. size_t cnt, loff_t *data)
  459. {
  460. unsigned long val;
  461. unsigned long update;
  462. int ret;
  463. ret = kstrtoul_from_user(ubuf, cnt, 10, &val);
  464. if (ret)
  465. return ret;
  466. update = enabled_signal_log ^ val;
  467. if (update & SI_GENERATE) {
  468. if (val & SI_GENERATE)
  469. register_trace_signal_generate(probe_signal_generate, NULL);
  470. else
  471. unregister_trace_signal_generate(probe_signal_generate, NULL);
  472. }
  473. if (update & SI_DELIVER) {
  474. if (val & SI_DELIVER)
  475. register_trace_signal_deliver(probe_signal_deliver, NULL);
  476. else
  477. unregister_trace_signal_deliver(probe_signal_deliver, NULL);
  478. }
  479. enabled_signal_log = val;
  480. return cnt;
  481. }
  482. static void __init init_signal_log(void)
  483. {
  484. if (enabled_signal_log & SI_GENERATE)
  485. register_trace_signal_generate(probe_signal_generate, NULL);
  486. if (enabled_signal_log & SI_DELIVER)
  487. register_trace_signal_deliver(probe_signal_deliver, NULL);
  488. register_trace_signal_deliver(probe_death_signal, NULL);
  489. }
  490. /*-------------------------------------------------------------------*/
  491. static int __init init_mtsched_prof(void)
  492. {
  493. struct proc_dir_entry *pe;
  494. if (!proc_mkdir("mtprof", NULL))
  495. return -1;
  496. pe = proc_create("mtprof/sched", 0444, NULL, &mt_sched_debug_fops);
  497. if (!pe)
  498. return -ENOMEM;
  499. #ifdef CONFIG_MTPROF_CPUTIME
  500. pe = proc_create("mtprof/cputime", 0664, NULL, &mt_cputime_fops);
  501. if (!pe)
  502. return -ENOMEM;
  503. #endif
  504. pe = proc_create("mtprof/reboot_pid", 0660, NULL, &mt_pid_fops);
  505. if (!pe)
  506. return -ENOMEM;
  507. init_signal_log();
  508. pe = proc_create("mtprof/signal_log", 0664, NULL, &mt_signal_log_fops);
  509. if (!pe)
  510. return -ENOMEM;
  511. mt_cpu_num = num_present_cpus();
  512. mt_cpu_info_head = kmalloc_array(mt_cpu_num, sizeof(struct mt_cpu_info), GFP_ATOMIC);
  513. if (mt_cpu_info_head == NULL)
  514. return -ENOMEM;
  515. #ifdef CONFIG_MT_ENG_BUILD
  516. pe = proc_create("mtprof/log", 0666, NULL, &mt_log_fops);
  517. if (!pe)
  518. return -ENOMEM;
  519. #endif
  520. return 0;
  521. }
  522. device_initcall(init_mtsched_prof);