Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F101301652
D6812.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6812.diff
View Options
Index: head/sys/conf/NOTES
===================================================================
--- head/sys/conf/NOTES
+++ head/sys/conf/NOTES
@@ -578,6 +578,17 @@
#
options STACK
+#
+# The NUM_CORE_FILES option specifies the limit for the number of core
+# files generated by a particular process, when the core file format
+# specifier includes the %I pattern. Since we only have 1 character for
+# the core count in the format string, meaning the range will be 0-9, the
+# maximum value allowed for this option is 10.
+# This core file limit can be adjusted at runtime via the debug.ncores
+# sysctl.
+#
+options NUM_CORE_FILES=5
+
#####################################################################
# PERFORMANCE MONITORING OPTIONS
Index: head/sys/conf/options
===================================================================
--- head/sys/conf/options
+++ head/sys/conf/options
@@ -65,6 +65,7 @@
EARLY_PRINTF opt_global.h
TEXTDUMP_PREFERRED opt_ddb.h
TEXTDUMP_VERBOSE opt_ddb.h
+NUM_CORE_FILES opt_global.h
# Miscellaneous options.
ADAPTIVE_LOCKMGRS
Index: head/sys/kern/kern_sig.c
===================================================================
--- head/sys/kern/kern_sig.c
+++ head/sys/kern/kern_sig.c
@@ -3142,8 +3142,12 @@
* We only have 1 character for the core count in the format
* string, so the range will be 0-9
*/
-#define MAX_NUM_CORES 10
-static int num_cores = 5;
+#define MAX_NUM_CORE_FILES 10
+#ifndef NUM_CORE_FILES
+#define NUM_CORE_FILES 5
+#endif
+CTASSERT(NUM_CORE_FILES >= 0 && NUM_CORE_FILES <= MAX_NUM_CORE_FILES);
+static int num_cores = NUM_CORE_FILES;
static int
sysctl_debug_num_cores_check (SYSCTL_HANDLER_ARGS)
@@ -3155,8 +3159,8 @@
error = sysctl_handle_int(oidp, &new_val, 0, req);
if (error != 0 || req->newptr == NULL)
return (error);
- if (new_val > MAX_NUM_CORES)
- new_val = MAX_NUM_CORES;
+ if (new_val > MAX_NUM_CORE_FILES)
+ new_val = MAX_NUM_CORE_FILES;
if (new_val < 0)
new_val = 0;
num_cores = new_val;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 28, 11:21 AM (22 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14367679
Default Alt Text
D6812.diff (1 KB)
Attached To
Mode
D6812: Allow specifying number of cores allowed via kernel config
Attached
Detach File
Event Timeline
Log In to Comment