@@ -25,6 +25,7 @@ pub struct SystemSettings {
2525 pub profiling_allocation_enabled : bool ,
2626 pub profiling_timeline_enabled : bool ,
2727 pub profiling_exception_enabled : bool ,
28+ pub profiling_exception_message_enabled : bool ,
2829
2930 // todo: can't this be Option<String>? I don't think the string can ever be static.
3031 pub output_pprof : Option < Cow < ' static , str > > ,
@@ -42,6 +43,7 @@ impl SystemSettings {
4243 self . profiling_allocation_enabled = false ;
4344 self . profiling_timeline_enabled = false ;
4445 self . profiling_exception_enabled = false ;
46+ self . profiling_exception_message_enabled = false ;
4547 }
4648
4749 /// # Safety
@@ -62,6 +64,7 @@ impl SystemSettings {
6264 profiling_allocation_enabled : profiling_allocation_enabled ( ) ,
6365 profiling_timeline_enabled : profiling_timeline_enabled ( ) ,
6466 profiling_exception_enabled : profiling_exception_enabled ( ) ,
67+ profiling_exception_message_enabled : profiling_exception_message_enabled ( ) ,
6568 output_pprof : profiling_output_pprof ( ) ,
6669 profiling_exception_sampling_distance : profiling_exception_sampling_distance ( ) ,
6770 profiling_log_level : profiling_log_level ( ) ,
@@ -122,6 +125,7 @@ impl SystemSettings {
122125 profiling_allocation_enabled : false ,
123126 profiling_timeline_enabled : false ,
124127 profiling_exception_enabled : false ,
128+ profiling_exception_message_enabled : false ,
125129 output_pprof : None ,
126130 profiling_exception_sampling_distance : 0 ,
127131 profiling_log_level : LevelFilter :: Off ,
@@ -138,6 +142,7 @@ impl SystemSettings {
138142 system_settings. profiling_allocation_enabled = false ;
139143 system_settings. profiling_timeline_enabled = false ;
140144 system_settings. profiling_exception_enabled = false ;
145+ system_settings. profiling_exception_message_enabled = false ;
141146 }
142147}
143148
@@ -332,6 +337,7 @@ pub(crate) enum ConfigId {
332337 ProfilingAllocationEnabled ,
333338 ProfilingTimelineEnabled ,
334339 ProfilingExceptionEnabled ,
340+ ProfilingExceptionMessageEnabled ,
335341 ProfilingExceptionSamplingDistance ,
336342 ProfilingLogLevel ,
337343 ProfilingOutputPprof ,
@@ -358,6 +364,7 @@ impl ConfigId {
358364 ProfilingAllocationEnabled => b"DD_PROFILING_ALLOCATION_ENABLED\0 " ,
359365 ProfilingTimelineEnabled => b"DD_PROFILING_TIMELINE_ENABLED\0 " ,
360366 ProfilingExceptionEnabled => b"DD_PROFILING_EXCEPTION_ENABLED\0 " ,
367+ ProfilingExceptionMessageEnabled => b"DD_PROFILING_EXCEPTION_MESSAGE_ENABLED\0 " ,
361368 ProfilingExceptionSamplingDistance => b"DD_PROFILING_EXCEPTION_SAMPLING_DISTANCE\0 " ,
362369 ProfilingLogLevel => b"DD_PROFILING_LOG_LEVEL\0 " ,
363370
@@ -400,6 +407,7 @@ lazy_static::lazy_static! {
400407 profiling_allocation_enabled: false ,
401408 profiling_timeline_enabled: false ,
402409 profiling_exception_enabled: false ,
410+ profiling_exception_message_enabled: false ,
403411 output_pprof: None ,
404412 profiling_exception_sampling_distance: u32 :: MAX ,
405413 profiling_log_level: LevelFilter :: Off ,
@@ -415,6 +423,7 @@ lazy_static::lazy_static! {
415423 profiling_allocation_enabled: true ,
416424 profiling_timeline_enabled: true ,
417425 profiling_exception_enabled: true ,
426+ profiling_exception_message_enabled: false ,
418427 output_pprof: None ,
419428 profiling_exception_sampling_distance: 100 ,
420429 profiling_log_level: LevelFilter :: Off ,
@@ -496,6 +505,16 @@ unsafe fn profiling_exception_enabled() -> bool {
496505 )
497506}
498507
508+ /// # Safety
509+ /// This function must only be called after config has been initialized in
510+ /// rinit, and before it is uninitialized in mshutdown.
511+ unsafe fn profiling_exception_message_enabled ( ) -> bool {
512+ get_system_bool (
513+ ProfilingExceptionMessageEnabled ,
514+ DEFAULT_SYSTEM_SETTINGS . profiling_exception_message_enabled ,
515+ )
516+ }
517+
499518/// # Safety
500519/// This function must only be called after config has been initialized in
501520/// rinit, and before it is uninitialized in mshutdown.
@@ -811,6 +830,16 @@ pub(crate) fn minit(module_number: libc::c_int) {
811830 ini_change : Some ( zai_config_system_ini_change) ,
812831 parser : None ,
813832 } ,
833+ zai_config_entry {
834+ id : transmute ( ProfilingExceptionMessageEnabled ) ,
835+ name : ProfilingExceptionMessageEnabled . env_var_name ( ) ,
836+ type_ : ZAI_CONFIG_TYPE_BOOL ,
837+ default_encoded_value : ZaiStr :: literal ( b"0\0 " ) ,
838+ aliases : ptr:: null_mut ( ) ,
839+ aliases_count : 0 ,
840+ ini_change : Some ( zai_config_system_ini_change) ,
841+ parser : None ,
842+ } ,
814843 zai_config_entry {
815844 id : transmute ( ProfilingExceptionSamplingDistance ) ,
816845 name : ProfilingExceptionSamplingDistance . env_var_name ( ) ,
0 commit comments