bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/4 gnumach] Allow disabling of MACH_PCSAMPLE and disable by defa


From: Damien Zammit
Subject: [PATCH 3/4 gnumach] Allow disabling of MACH_PCSAMPLE and disable by default
Date: Sat, 30 Sep 2023 06:31:04 +0000

This fixes a page fault when the sampling occurs in MP.
Perhaps it is not MP safe yet.
---
 configfrag.ac    |  2 +-
 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 */
 }
-- 
2.40.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]