profile.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. /*
  2. * linux/kernel/profile.c
  3. * Simple profiling. Manages a direct-mapped profile hit count buffer,
  4. * with configurable resolution, support for restricting the cpus on
  5. * which profiling is done, and switching between cpu time and
  6. * schedule() calls via kernel command line parameters passed at boot.
  7. *
  8. * Scheduler profiling support, Arjan van de Ven and Ingo Molnar,
  9. * Red Hat, July 2004
  10. * Consolidation of architecture support code for profiling,
  11. * Nadia Yvette Chambers, Oracle, July 2004
  12. * Amortized hit count accounting via per-cpu open-addressed hashtables
  13. * to resolve timer interrupt livelocks, Nadia Yvette Chambers,
  14. * Oracle, 2004
  15. */
  16. #include <linux/export.h>
  17. #include <linux/profile.h>
  18. #include <linux/bootmem.h>
  19. #include <linux/notifier.h>
  20. #include <linux/mm.h>
  21. #include <linux/cpumask.h>
  22. #include <linux/cpu.h>
  23. #include <linux/highmem.h>
  24. #include <linux/mutex.h>
  25. #include <linux/slab.h>
  26. #include <linux/vmalloc.h>
  27. #include <asm/sections.h>
  28. #include <asm/irq_regs.h>
  29. #include <asm/ptrace.h>
  30. struct profile_hit {
  31. u32 pc, hits;
  32. };
  33. #define PROFILE_GRPSHIFT 3
  34. #define PROFILE_GRPSZ (1 << PROFILE_GRPSHIFT)
  35. #define NR_PROFILE_HIT (PAGE_SIZE/sizeof(struct profile_hit))
  36. #define NR_PROFILE_GRP (NR_PROFILE_HIT/PROFILE_GRPSZ)
  37. static atomic_t *prof_buffer;
  38. static unsigned long prof_len, prof_shift;
  39. int prof_on __read_mostly;
  40. EXPORT_SYMBOL_GPL(prof_on);
  41. static cpumask_var_t prof_cpu_mask;
  42. #ifdef CONFIG_SMP
  43. static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits);
  44. static DEFINE_PER_CPU(int, cpu_profile_flip);
  45. static DEFINE_MUTEX(profile_flip_mutex);
  46. #endif /* CONFIG_SMP */
  47. int profile_setup(char *str)
  48. {
  49. static char schedstr[] = "schedule";
  50. static char sleepstr[] = "sleep";
  51. static char kvmstr[] = "kvm";
  52. int par;
  53. if (!strncmp(str, sleepstr, strlen(sleepstr))) {
  54. #ifdef CONFIG_SCHEDSTATS
  55. prof_on = SLEEP_PROFILING;
  56. if (str[strlen(sleepstr)] == ',')
  57. str += strlen(sleepstr) + 1;
  58. if (get_option(&str, &par))
  59. prof_shift = par;
  60. printk(KERN_INFO
  61. "kernel sleep profiling enabled (shift: %ld)\n",
  62. prof_shift);
  63. #else
  64. printk(KERN_WARNING
  65. "kernel sleep profiling requires CONFIG_SCHEDSTATS\n");
  66. #endif /* CONFIG_SCHEDSTATS */
  67. } else if (!strncmp(str, schedstr, strlen(schedstr))) {
  68. prof_on = SCHED_PROFILING;
  69. if (str[strlen(schedstr)] == ',')
  70. str += strlen(schedstr) + 1;
  71. if (get_option(&str, &par))
  72. prof_shift = par;
  73. printk(KERN_INFO
  74. "kernel schedule profiling enabled (shift: %ld)\n",
  75. prof_shift);
  76. } else if (!strncmp(str, kvmstr, strlen(kvmstr))) {
  77. prof_on = KVM_PROFILING;
  78. if (str[strlen(kvmstr)] == ',')
  79. str += strlen(kvmstr) + 1;
  80. if (get_option(&str, &par))
  81. prof_shift = par;
  82. printk(KERN_INFO
  83. "kernel KVM profiling enabled (shift: %ld)\n",
  84. prof_shift);
  85. } else if (get_option(&str, &par)) {
  86. prof_shift = par;
  87. prof_on = CPU_PROFILING;
  88. printk(KERN_INFO "kernel profiling enabled (shift: %ld)\n",
  89. prof_shift);
  90. }
  91. return 1;
  92. }
  93. __setup("profile=", profile_setup);
  94. int __ref profile_init(void)
  95. {
  96. int buffer_bytes;
  97. if (!prof_on)
  98. return 0;
  99. /* only text is profiled */
  100. prof_len = (_etext - _stext) >> prof_shift;
  101. buffer_bytes = prof_len*sizeof(atomic_t);
  102. if (!alloc_cpumask_var(&prof_cpu_mask, GFP_KERNEL))
  103. return -ENOMEM;
  104. cpumask_copy(prof_cpu_mask, cpu_possible_mask);
  105. prof_buffer = kzalloc(buffer_bytes, GFP_KERNEL|__GFP_NOWARN);
  106. if (prof_buffer)
  107. return 0;
  108. prof_buffer = alloc_pages_exact(buffer_bytes,
  109. GFP_KERNEL|__GFP_ZERO|__GFP_NOWARN);
  110. if (prof_buffer)
  111. return 0;
  112. prof_buffer = vzalloc(buffer_bytes);
  113. if (prof_buffer)
  114. return 0;
  115. free_cpumask_var(prof_cpu_mask);
  116. return -ENOMEM;
  117. }
  118. /* Profile event notifications */
  119. static BLOCKING_NOTIFIER_HEAD(task_exit_notifier);
  120. static ATOMIC_NOTIFIER_HEAD(task_free_notifier);
  121. static BLOCKING_NOTIFIER_HEAD(munmap_notifier);
  122. void profile_task_exit(struct task_struct *task)
  123. {
  124. blocking_notifier_call_chain(&task_exit_notifier, 0, task);
  125. }
  126. int profile_handoff_task(struct task_struct *task)
  127. {
  128. int ret;
  129. ret = atomic_notifier_call_chain(&task_free_notifier, 0, task);
  130. return (ret == NOTIFY_OK) ? 1 : 0;
  131. }
  132. void profile_munmap(unsigned long addr)
  133. {
  134. blocking_notifier_call_chain(&munmap_notifier, 0, (void *)addr);
  135. }
  136. int task_handoff_register(struct notifier_block *n)
  137. {
  138. return atomic_notifier_chain_register(&task_free_notifier, n);
  139. }
  140. EXPORT_SYMBOL_GPL(task_handoff_register);
  141. int task_handoff_unregister(struct notifier_block *n)
  142. {
  143. return atomic_notifier_chain_unregister(&task_free_notifier, n);
  144. }
  145. EXPORT_SYMBOL_GPL(task_handoff_unregister);
  146. int profile_event_register(enum profile_type type, struct notifier_block *n)
  147. {
  148. int err = -EINVAL;
  149. switch (type) {
  150. case PROFILE_TASK_EXIT:
  151. err = blocking_notifier_chain_register(
  152. &task_exit_notifier, n);
  153. break;
  154. case PROFILE_MUNMAP:
  155. err = blocking_notifier_chain_register(
  156. &munmap_notifier, n);
  157. break;
  158. }
  159. return err;
  160. }
  161. EXPORT_SYMBOL_GPL(profile_event_register);
  162. int profile_event_unregister(enum profile_type type, struct notifier_block *n)
  163. {
  164. int err = -EINVAL;
  165. switch (type) {
  166. case PROFILE_TASK_EXIT:
  167. err = blocking_notifier_chain_unregister(
  168. &task_exit_notifier, n);
  169. break;
  170. case PROFILE_MUNMAP:
  171. err = blocking_notifier_chain_unregister(
  172. &munmap_notifier, n);
  173. break;
  174. }
  175. return err;
  176. }
  177. EXPORT_SYMBOL_GPL(profile_event_unregister);
  178. #ifdef CONFIG_SMP
  179. /*
  180. * Each cpu has a pair of open-addressed hashtables for pending
  181. * profile hits. read_profile() IPI's all cpus to request them
  182. * to flip buffers and flushes their contents to prof_buffer itself.
  183. * Flip requests are serialized by the profile_flip_mutex. The sole
  184. * use of having a second hashtable is for avoiding cacheline
  185. * contention that would otherwise happen during flushes of pending
  186. * profile hits required for the accuracy of reported profile hits
  187. * and so resurrect the interrupt livelock issue.
  188. *
  189. * The open-addressed hashtables are indexed by profile buffer slot
  190. * and hold the number of pending hits to that profile buffer slot on
  191. * a cpu in an entry. When the hashtable overflows, all pending hits
  192. * are accounted to their corresponding profile buffer slots with
  193. * atomic_add() and the hashtable emptied. As numerous pending hits
  194. * may be accounted to a profile buffer slot in a hashtable entry,
  195. * this amortizes a number of atomic profile buffer increments likely
  196. * to be far larger than the number of entries in the hashtable,
  197. * particularly given that the number of distinct profile buffer
  198. * positions to which hits are accounted during short intervals (e.g.
  199. * several seconds) is usually very small. Exclusion from buffer
  200. * flipping is provided by interrupt disablement (note that for
  201. * SCHED_PROFILING or SLEEP_PROFILING profile_hit() may be called from
  202. * process context).
  203. * The hash function is meant to be lightweight as opposed to strong,
  204. * and was vaguely inspired by ppc64 firmware-supported inverted
  205. * pagetable hash functions, but uses a full hashtable full of finite
  206. * collision chains, not just pairs of them.
  207. *
  208. * -- nyc
  209. */
  210. static void __profile_flip_buffers(void *unused)
  211. {
  212. int cpu = smp_processor_id();
  213. per_cpu(cpu_profile_flip, cpu) = !per_cpu(cpu_profile_flip, cpu);
  214. }
  215. static void profile_flip_buffers(void)
  216. {
  217. int i, j, cpu;
  218. mutex_lock(&profile_flip_mutex);
  219. j = per_cpu(cpu_profile_flip, get_cpu());
  220. put_cpu();
  221. on_each_cpu(__profile_flip_buffers, NULL, 1);
  222. for_each_online_cpu(cpu) {
  223. struct profile_hit *hits = per_cpu(cpu_profile_hits, cpu)[j];
  224. for (i = 0; i < NR_PROFILE_HIT; ++i) {
  225. if (!hits[i].hits) {
  226. if (hits[i].pc)
  227. hits[i].pc = 0;
  228. continue;
  229. }
  230. atomic_add(hits[i].hits, &prof_buffer[hits[i].pc]);
  231. hits[i].hits = hits[i].pc = 0;
  232. }
  233. }
  234. mutex_unlock(&profile_flip_mutex);
  235. }
  236. static void profile_discard_flip_buffers(void)
  237. {
  238. int i, cpu;
  239. mutex_lock(&profile_flip_mutex);
  240. i = per_cpu(cpu_profile_flip, get_cpu());
  241. put_cpu();
  242. on_each_cpu(__profile_flip_buffers, NULL, 1);
  243. for_each_online_cpu(cpu) {
  244. struct profile_hit *hits = per_cpu(cpu_profile_hits, cpu)[i];
  245. memset(hits, 0, NR_PROFILE_HIT*sizeof(struct profile_hit));
  246. }
  247. mutex_unlock(&profile_flip_mutex);
  248. }
  249. static void do_profile_hits(int type, void *__pc, unsigned int nr_hits)
  250. {
  251. unsigned long primary, secondary, flags, pc = (unsigned long)__pc;
  252. int i, j, cpu;
  253. struct profile_hit *hits;
  254. pc = min((pc - (unsigned long)_stext) >> prof_shift, prof_len - 1);
  255. i = primary = (pc & (NR_PROFILE_GRP - 1)) << PROFILE_GRPSHIFT;
  256. secondary = (~(pc << 1) & (NR_PROFILE_GRP - 1)) << PROFILE_GRPSHIFT;
  257. cpu = get_cpu();
  258. hits = per_cpu(cpu_profile_hits, cpu)[per_cpu(cpu_profile_flip, cpu)];
  259. if (!hits) {
  260. put_cpu();
  261. return;
  262. }
  263. /*
  264. * We buffer the global profiler buffer into a per-CPU
  265. * queue and thus reduce the number of global (and possibly
  266. * NUMA-alien) accesses. The write-queue is self-coalescing:
  267. */
  268. local_irq_save(flags);
  269. do {
  270. for (j = 0; j < PROFILE_GRPSZ; ++j) {
  271. if (hits[i + j].pc == pc) {
  272. hits[i + j].hits += nr_hits;
  273. goto out;
  274. } else if (!hits[i + j].hits) {
  275. hits[i + j].pc = pc;
  276. hits[i + j].hits = nr_hits;
  277. goto out;
  278. }
  279. }
  280. i = (i + secondary) & (NR_PROFILE_HIT - 1);
  281. } while (i != primary);
  282. /*
  283. * Add the current hit(s) and flush the write-queue out
  284. * to the global buffer:
  285. */
  286. atomic_add(nr_hits, &prof_buffer[pc]);
  287. for (i = 0; i < NR_PROFILE_HIT; ++i) {
  288. atomic_add(hits[i].hits, &prof_buffer[hits[i].pc]);
  289. hits[i].pc = hits[i].hits = 0;
  290. }
  291. out:
  292. local_irq_restore(flags);
  293. put_cpu();
  294. }
  295. static int __cpuinit profile_cpu_callback(struct notifier_block *info,
  296. unsigned long action, void *__cpu)
  297. {
  298. int node, cpu = (unsigned long)__cpu;
  299. struct page *page;
  300. switch (action) {
  301. case CPU_UP_PREPARE:
  302. case CPU_UP_PREPARE_FROZEN:
  303. node = cpu_to_mem(cpu);
  304. per_cpu(cpu_profile_flip, cpu) = 0;
  305. if (!per_cpu(cpu_profile_hits, cpu)[1]) {
  306. page = alloc_pages_exact_node(node,
  307. GFP_KERNEL | __GFP_ZERO,
  308. 0);
  309. if (!page)
  310. return notifier_from_errno(-ENOMEM);
  311. per_cpu(cpu_profile_hits, cpu)[1] = page_address(page);
  312. }
  313. if (!per_cpu(cpu_profile_hits, cpu)[0]) {
  314. page = alloc_pages_exact_node(node,
  315. GFP_KERNEL | __GFP_ZERO,
  316. 0);
  317. if (!page)
  318. goto out_free;
  319. per_cpu(cpu_profile_hits, cpu)[0] = page_address(page);
  320. }
  321. break;
  322. out_free:
  323. page = virt_to_page(per_cpu(cpu_profile_hits, cpu)[1]);
  324. per_cpu(cpu_profile_hits, cpu)[1] = NULL;
  325. __free_page(page);
  326. return notifier_from_errno(-ENOMEM);
  327. case CPU_ONLINE:
  328. case CPU_ONLINE_FROZEN:
  329. if (prof_cpu_mask != NULL)
  330. cpumask_set_cpu(cpu, prof_cpu_mask);
  331. break;
  332. case CPU_UP_CANCELED:
  333. case CPU_UP_CANCELED_FROZEN:
  334. case CPU_DEAD:
  335. case CPU_DEAD_FROZEN:
  336. if (prof_cpu_mask != NULL)
  337. cpumask_clear_cpu(cpu, prof_cpu_mask);
  338. if (per_cpu(cpu_profile_hits, cpu)[0]) {
  339. page = virt_to_page(per_cpu(cpu_profile_hits, cpu)[0]);
  340. per_cpu(cpu_profile_hits, cpu)[0] = NULL;
  341. __free_page(page);
  342. }
  343. if (per_cpu(cpu_profile_hits, cpu)[1]) {
  344. page = virt_to_page(per_cpu(cpu_profile_hits, cpu)[1]);
  345. per_cpu(cpu_profile_hits, cpu)[1] = NULL;
  346. __free_page(page);
  347. }
  348. break;
  349. }
  350. return NOTIFY_OK;
  351. }
  352. #else /* !CONFIG_SMP */
  353. #define profile_flip_buffers() do { } while (0)
  354. #define profile_discard_flip_buffers() do { } while (0)
  355. #define profile_cpu_callback NULL
  356. static void do_profile_hits(int type, void *__pc, unsigned int nr_hits)
  357. {
  358. unsigned long pc;
  359. pc = ((unsigned long)__pc - (unsigned long)_stext) >> prof_shift;
  360. atomic_add(nr_hits, &prof_buffer[min(pc, prof_len - 1)]);
  361. }
  362. #endif /* !CONFIG_SMP */
  363. void profile_hits(int type, void *__pc, unsigned int nr_hits)
  364. {
  365. if (prof_on != type || !prof_buffer)
  366. return;
  367. do_profile_hits(type, __pc, nr_hits);
  368. }
  369. EXPORT_SYMBOL_GPL(profile_hits);
  370. void profile_tick(int type)
  371. {
  372. struct pt_regs *regs = get_irq_regs();
  373. if (!user_mode(regs) && prof_cpu_mask != NULL &&
  374. cpumask_test_cpu(smp_processor_id(), prof_cpu_mask))
  375. profile_hit(type, (void *)profile_pc(regs));
  376. }
  377. #ifdef CONFIG_PROC_FS
  378. #include <linux/proc_fs.h>
  379. #include <linux/seq_file.h>
  380. #include <asm/uaccess.h>
  381. static int prof_cpu_mask_proc_show(struct seq_file *m, void *v)
  382. {
  383. seq_cpumask(m, prof_cpu_mask);
  384. seq_putc(m, '\n');
  385. return 0;
  386. }
  387. static int prof_cpu_mask_proc_open(struct inode *inode, struct file *file)
  388. {
  389. return single_open(file, prof_cpu_mask_proc_show, NULL);
  390. }
  391. static ssize_t prof_cpu_mask_proc_write(struct file *file,
  392. const char __user *buffer, size_t count, loff_t *pos)
  393. {
  394. cpumask_var_t new_value;
  395. int err;
  396. if (!alloc_cpumask_var(&new_value, GFP_KERNEL))
  397. return -ENOMEM;
  398. err = cpumask_parse_user(buffer, count, new_value);
  399. if (!err) {
  400. cpumask_copy(prof_cpu_mask, new_value);
  401. err = count;
  402. }
  403. free_cpumask_var(new_value);
  404. return err;
  405. }
  406. static const struct file_operations prof_cpu_mask_proc_fops = {
  407. .open = prof_cpu_mask_proc_open,
  408. .read = seq_read,
  409. .llseek = seq_lseek,
  410. .release = single_release,
  411. .write = prof_cpu_mask_proc_write,
  412. };
  413. void create_prof_cpu_mask(struct proc_dir_entry *root_irq_dir)
  414. {
  415. /* create /proc/irq/prof_cpu_mask */
  416. proc_create("prof_cpu_mask", 0600, root_irq_dir, &prof_cpu_mask_proc_fops);
  417. }
  418. /*
  419. * This function accesses profiling information. The returned data is
  420. * binary: the sampling step and the actual contents of the profile
  421. * buffer. Use of the program readprofile is recommended in order to
  422. * get meaningful info out of these data.
  423. */
  424. static ssize_t
  425. read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos)
  426. {
  427. unsigned long p = *ppos;
  428. ssize_t read;
  429. char *pnt;
  430. unsigned int sample_step = 1 << prof_shift;
  431. profile_flip_buffers();
  432. if (p >= (prof_len+1)*sizeof(unsigned int))
  433. return 0;
  434. if (count > (prof_len+1)*sizeof(unsigned int) - p)
  435. count = (prof_len+1)*sizeof(unsigned int) - p;
  436. read = 0;
  437. while (p < sizeof(unsigned int) && count > 0) {
  438. if (put_user(*((char *)(&sample_step)+p), buf))
  439. return -EFAULT;
  440. buf++; p++; count--; read++;
  441. }
  442. pnt = (char *)prof_buffer + p - sizeof(atomic_t);
  443. if (copy_to_user(buf, (void *)pnt, count))
  444. return -EFAULT;
  445. read += count;
  446. *ppos += read;
  447. return read;
  448. }
  449. /*
  450. * Writing to /proc/profile resets the counters
  451. *
  452. * Writing a 'profiling multiplier' value into it also re-sets the profiling
  453. * interrupt frequency, on architectures that support this.
  454. */
  455. static ssize_t write_profile(struct file *file, const char __user *buf,
  456. size_t count, loff_t *ppos)
  457. {
  458. #ifdef CONFIG_SMP
  459. extern int setup_profiling_timer(unsigned int multiplier);
  460. if (count == sizeof(int)) {
  461. unsigned int multiplier;
  462. if (copy_from_user(&multiplier, buf, sizeof(int)))
  463. return -EFAULT;
  464. if (setup_profiling_timer(multiplier))
  465. return -EINVAL;
  466. }
  467. #endif
  468. profile_discard_flip_buffers();
  469. memset(prof_buffer, 0, prof_len * sizeof(atomic_t));
  470. return count;
  471. }
  472. static const struct file_operations proc_profile_operations = {
  473. .read = read_profile,
  474. .write = write_profile,
  475. .llseek = default_llseek,
  476. };
  477. #ifdef CONFIG_SMP
  478. static void profile_nop(void *unused)
  479. {
  480. }
  481. static int create_hash_tables(void)
  482. {
  483. int cpu;
  484. for_each_online_cpu(cpu) {
  485. int node = cpu_to_mem(cpu);
  486. struct page *page;
  487. page = alloc_pages_exact_node(node,
  488. GFP_KERNEL | __GFP_ZERO | GFP_THISNODE,
  489. 0);
  490. if (!page)
  491. goto out_cleanup;
  492. per_cpu(cpu_profile_hits, cpu)[1]
  493. = (struct profile_hit *)page_address(page);
  494. page = alloc_pages_exact_node(node,
  495. GFP_KERNEL | __GFP_ZERO | GFP_THISNODE,
  496. 0);
  497. if (!page)
  498. goto out_cleanup;
  499. per_cpu(cpu_profile_hits, cpu)[0]
  500. = (struct profile_hit *)page_address(page);
  501. }
  502. return 0;
  503. out_cleanup:
  504. prof_on = 0;
  505. smp_mb();
  506. on_each_cpu(profile_nop, NULL, 1);
  507. for_each_online_cpu(cpu) {
  508. struct page *page;
  509. if (per_cpu(cpu_profile_hits, cpu)[0]) {
  510. page = virt_to_page(per_cpu(cpu_profile_hits, cpu)[0]);
  511. per_cpu(cpu_profile_hits, cpu)[0] = NULL;
  512. __free_page(page);
  513. }
  514. if (per_cpu(cpu_profile_hits, cpu)[1]) {
  515. page = virt_to_page(per_cpu(cpu_profile_hits, cpu)[1]);
  516. per_cpu(cpu_profile_hits, cpu)[1] = NULL;
  517. __free_page(page);
  518. }
  519. }
  520. return -1;
  521. }
  522. #else
  523. #define create_hash_tables() ({ 0; })
  524. #endif
  525. int __ref create_proc_profile(void) /* false positive from hotcpu_notifier */
  526. {
  527. struct proc_dir_entry *entry;
  528. if (!prof_on)
  529. return 0;
  530. if (create_hash_tables())
  531. return -ENOMEM;
  532. entry = proc_create("profile", S_IWUSR | S_IRUGO,
  533. NULL, &proc_profile_operations);
  534. if (!entry)
  535. return 0;
  536. entry->size = (1+prof_len) * sizeof(atomic_t);
  537. hotcpu_notifier(profile_cpu_callback, 0);
  538. return 0;
  539. }
  540. module_init(create_proc_profile);
  541. #endif /* CONFIG_PROC_FS */