diff options
author | Damien Zammit <damien@zamaudio.com> | 2023-09-30 06:31:04 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-09-30 10:47:40 +0200 |
commit | 507dc37fa014714d4cc74df221227e0894d042c2 (patch) | |
tree | c1dc083129a697802e99a3465e71cc9edbb521e4 | |
parent | 4492f5358da5a933af270dac7109f689bebe2a37 (diff) | |
download | gnumach-507dc37fa014714d4cc74df221227e0894d042c2.tar.gz gnumach-507dc37fa014714d4cc74df221227e0894d042c2.tar.bz2 gnumach-507dc37fa014714d4cc74df221227e0894d042c2.zip |
Allow disabling of MACH_PCSAMPLE and disable by default
This fixes a page fault when the sampling occurs in MP.
Perhaps it is not MP safe yet.
Message-Id: <20230930063032.75232-4-damien@zamaudio.com>
-rw-r--r-- | configfrag.ac | 2 | ||||
-rw-r--r-- | kern/pc_sample.c | 32 |
2 files changed, 17 insertions, 17 deletions
diff --git a/configfrag.ac b/configfrag.ac index 3c3ba3aa..290a1596 100644 --- a/configfrag.ac +++ b/configfrag.ac @@ -99,7 +99,7 @@ AC_DEFINE([MACH_MP_DEBUG], [0], [MACH_MP_DEBUG]) AC_DEFINE([MACH_PAGEMAP], [1], [MACH_PAGEMAP]) # Do pc sample histogram. -AC_DEFINE([MACH_PCSAMPLE], [1], [MACH_PCSAMPLE]) +AC_DEFINE([MACH_PCSAMPLE], [0], [MACH_PCSAMPLE]) # Sample kernel too. AC_ARG_ENABLE([kernsample], diff --git a/kern/pc_sample.c b/kern/pc_sample.c index 9ac18821..497bd894 100644 --- a/kern/pc_sample.c +++ b/kern/pc_sample.c @@ -251,8 +251,8 @@ task_get_sampled_pcs( kern_return_t thread_enable_pc_sampling( - const thread_t thread, - const int *tickp, + thread_t thread, + int *tickp, sampled_pc_flavor_t flavors) { return KERN_FAILURE; /* not implemented */ @@ -260,8 +260,8 @@ thread_enable_pc_sampling( kern_return_t task_enable_pc_sampling( - const task_t task, - const int *tickp, + task_t task, + int *tickp, sampled_pc_flavor_t flavors) { return KERN_FAILURE; /* not implemented */ @@ -269,36 +269,36 @@ task_enable_pc_sampling( kern_return_t thread_disable_pc_sampling( - const thread_t thread, - const int *samplecntp) + thread_t thread, + int *samplecntp) { return KERN_FAILURE; /* not implemented */ } kern_return_t task_disable_pc_sampling( - const task_t task, - const int *samplecntp) + task_t task, + int *samplecntp) { return KERN_FAILURE; /* not implemented */ } kern_return_t thread_get_sampled_pcs( - const thread_t thread, - const sampled_pc_seqno_t *seqnop, - const sampled_pc_array_t sampled_pcs_out, - const int *sampled_pcs_cntp) + thread_t thread, + sampled_pc_seqno_t *seqnop, + sampled_pc_array_t sampled_pcs_out, + mach_msg_type_number_t *sampled_pcs_cntp) { return KERN_FAILURE; /* not implemented */ } kern_return_t task_get_sampled_pcs( - const task_t task, - const sampled_pc_seqno_t *seqnop, - const sampled_pc_array_t sampled_pcs_out, - const int *sampled_pcs_cntp) + task_t task, + sampled_pc_seqno_t *seqnop, + sampled_pc_array_t sampled_pcs_out, + mach_msg_type_number_t *sampled_pcs_cntp) { return KERN_FAILURE; /* not implemented */ } |