diff options
Diffstat (limited to 'arch/ia64/kernel/perfmon.c')
-rw-r--r-- | arch/ia64/kernel/perfmon.c | 67 |
1 files changed, 52 insertions, 15 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index aa94f60fa8e7..2ecb20b551e1 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -521,19 +521,57 @@ pfm_sysctl_t pfm_sysctl; | |||
521 | EXPORT_SYMBOL(pfm_sysctl); | 521 | EXPORT_SYMBOL(pfm_sysctl); |
522 | 522 | ||
523 | static ctl_table pfm_ctl_table[]={ | 523 | static ctl_table pfm_ctl_table[]={ |
524 | {1, "debug", &pfm_sysctl.debug, sizeof(int), 0666, NULL, &proc_dointvec, NULL,}, | 524 | { |
525 | {2, "debug_ovfl", &pfm_sysctl.debug_ovfl, sizeof(int), 0666, NULL, &proc_dointvec, NULL,}, | 525 | .ctl_name = CTL_UNNUMBERED, |
526 | {3, "fastctxsw", &pfm_sysctl.fastctxsw, sizeof(int), 0600, NULL, &proc_dointvec, NULL,}, | 526 | .procname = "debug", |
527 | {4, "expert_mode", &pfm_sysctl.expert_mode, sizeof(int), 0600, NULL, &proc_dointvec, NULL,}, | 527 | .data = &pfm_sysctl.debug, |
528 | { 0, }, | 528 | .maxlen = sizeof(int), |
529 | .mode = 0666, | ||
530 | .proc_handler = &proc_dointvec, | ||
531 | }, | ||
532 | { | ||
533 | .ctl_name = CTL_UNNUMBERED, | ||
534 | .procname = "debug_ovfl", | ||
535 | .data = &pfm_sysctl.debug_ovfl, | ||
536 | .maxlen = sizeof(int), | ||
537 | .mode = 0666, | ||
538 | .proc_handler = &proc_dointvec, | ||
539 | }, | ||
540 | { | ||
541 | .ctl_name = CTL_UNNUMBERED, | ||
542 | .procname = "fastctxsw", | ||
543 | .data = &pfm_sysctl.fastctxsw, | ||
544 | .maxlen = sizeof(int), | ||
545 | .mode = 0600, | ||
546 | .proc_handler = &proc_dointvec, | ||
547 | }, | ||
548 | { | ||
549 | .ctl_name = CTL_UNNUMBERED, | ||
550 | .procname = "expert_mode", | ||
551 | .data = &pfm_sysctl.expert_mode, | ||
552 | .maxlen = sizeof(int), | ||
553 | .mode = 0600, | ||
554 | .proc_handler = &proc_dointvec, | ||
555 | }, | ||
556 | {} | ||
529 | }; | 557 | }; |
530 | static ctl_table pfm_sysctl_dir[] = { | 558 | static ctl_table pfm_sysctl_dir[] = { |
531 | {1, "perfmon", NULL, 0, 0755, pfm_ctl_table, }, | 559 | { |
532 | {0,}, | 560 | .ctl_name = CTL_UNNUMBERED, |
561 | .procname = "perfmon", | ||
562 | .mode = 0755, | ||
563 | .child = pfm_ctl_table, | ||
564 | }, | ||
565 | {} | ||
533 | }; | 566 | }; |
534 | static ctl_table pfm_sysctl_root[] = { | 567 | static ctl_table pfm_sysctl_root[] = { |
535 | {1, "kernel", NULL, 0, 0755, pfm_sysctl_dir, }, | 568 | { |
536 | {0,}, | 569 | .ctl_name = CTL_KERN, |
570 | .procname = "kernel", | ||
571 | .mode = 0755, | ||
572 | .child = pfm_sysctl_dir, | ||
573 | }, | ||
574 | {} | ||
537 | }; | 575 | }; |
538 | static struct ctl_table_header *pfm_sysctl_header; | 576 | static struct ctl_table_header *pfm_sysctl_header; |
539 | 577 | ||
@@ -621,7 +659,7 @@ EXPORT_PER_CPU_SYMBOL_GPL(pfm_syst_info); | |||
621 | 659 | ||
622 | 660 | ||
623 | /* forward declaration */ | 661 | /* forward declaration */ |
624 | static struct file_operations pfm_file_ops; | 662 | static const struct file_operations pfm_file_ops; |
625 | 663 | ||
626 | /* | 664 | /* |
627 | * forward declarations | 665 | * forward declarations |
@@ -2126,7 +2164,7 @@ pfm_no_open(struct inode *irrelevant, struct file *dontcare) | |||
2126 | 2164 | ||
2127 | 2165 | ||
2128 | 2166 | ||
2129 | static struct file_operations pfm_file_ops = { | 2167 | static const struct file_operations pfm_file_ops = { |
2130 | .llseek = no_llseek, | 2168 | .llseek = no_llseek, |
2131 | .read = pfm_read, | 2169 | .read = pfm_read, |
2132 | .write = pfm_write, | 2170 | .write = pfm_write, |
@@ -2301,12 +2339,11 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon | |||
2301 | DPRINT(("smpl_buf @%p\n", smpl_buf)); | 2339 | DPRINT(("smpl_buf @%p\n", smpl_buf)); |
2302 | 2340 | ||
2303 | /* allocate vma */ | 2341 | /* allocate vma */ |
2304 | vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL); | 2342 | vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); |
2305 | if (!vma) { | 2343 | if (!vma) { |
2306 | DPRINT(("Cannot allocate vma\n")); | 2344 | DPRINT(("Cannot allocate vma\n")); |
2307 | goto error_kmem; | 2345 | goto error_kmem; |
2308 | } | 2346 | } |
2309 | memset(vma, 0, sizeof(*vma)); | ||
2310 | 2347 | ||
2311 | /* | 2348 | /* |
2312 | * partially initialize the vma for the sampling buffer | 2349 | * partially initialize the vma for the sampling buffer |
@@ -6597,7 +6634,7 @@ found: | |||
6597 | return 0; | 6634 | return 0; |
6598 | } | 6635 | } |
6599 | 6636 | ||
6600 | static struct file_operations pfm_proc_fops = { | 6637 | static const struct file_operations pfm_proc_fops = { |
6601 | .open = pfm_proc_open, | 6638 | .open = pfm_proc_open, |
6602 | .read = seq_read, | 6639 | .read = seq_read, |
6603 | .llseek = seq_lseek, | 6640 | .llseek = seq_lseek, |
@@ -6689,7 +6726,7 @@ pfm_init(void) | |||
6689 | /* | 6726 | /* |
6690 | * create /proc/sys/kernel/perfmon (for debugging purposes) | 6727 | * create /proc/sys/kernel/perfmon (for debugging purposes) |
6691 | */ | 6728 | */ |
6692 | pfm_sysctl_header = register_sysctl_table(pfm_sysctl_root, 0); | 6729 | pfm_sysctl_header = register_sysctl_table(pfm_sysctl_root); |
6693 | 6730 | ||
6694 | /* | 6731 | /* |
6695 | * initialize all our spinlocks | 6732 | * initialize all our spinlocks |