Changeset View
Standalone View
sys/kern/imgact_elf.c
Show First 20 Lines • Show All 1,699 Lines • ▼ Show 20 Lines | #ifdef RACCT | ||||
} | } | ||||
#endif | #endif | ||||
if (coresize >= limit) { | if (coresize >= limit) { | ||||
error = EFAULT; | error = EFAULT; | ||||
goto done; | goto done; | ||||
} | } | ||||
/* Create a compression stream if necessary. */ | /* Create a compression stream if necessary. */ | ||||
if (compress_user_cores != 0) { | if (compress_user_cores != 0 && !(flags & SVC_NOCOMPRESS)) { | ||||
emaste: So if global `compress_user_cores` is not set `PT_COREDUMP` cores are also uncompressed? | |||||
Done Inline ActionsInitial intent was to make a flag to adjust global settings. But ok, I now made PC_COMPRESS completely independent from the configuration for automatic core dump. Next logical step would be to add an option to gcore to request compressed dump, but then it raises the question why this option is only implemented for -k. kib: Initial intent was to make a flag to adjust global settings. But ok, I now made PC_COMPRESS… | |||||
Done Inline ActionsIf it's completely independent, shouldn't the check be if (((flags & SVC_PT_COREDUMP) == 0 && compress_user_cores) || (flags & (SVC_PT_COREDUMP | SVC_NOCOMPRESS)) == SVC_PT_COREDUMP)? Also we may use either zlib or zstd for compression, and this is controlled by a different global setting. markj: If it's completely independent, shouldn't the check be `if (((flags & SVC_PT_COREDUMP) == 0 &&… | |||||
Done Inline ActionsI think it is good enough for now to not provide a selection of compression method through flags. kib: I think it is good enough for now to not provide a selection of compression method through… | |||||
Done Inline ActionsI'd be fine with simply not supporting compression at all through this interface, at least initially. In fact I believe the interface is somewhat broken: if SVC_NOCOMPRESS is not set, we will try to use the value of compress_user_cores as the compression algorithm, and if it is not configured compressor_init() will return an error. I think it was correct before my earlier suggestion, sorry. At the very least I think this knob, kern.compress_user_cores, should be referenced in the documentation. markj: I'd be fine with simply not supporting compression at all through this interface, at least… | |||||
params.comp = compressor_init(core_compressed_write, | params.comp = compressor_init(core_compressed_write, | ||||
compress_user_cores, CORE_BUF_SIZE, | compress_user_cores, CORE_BUF_SIZE, | ||||
compress_user_cores_level, ¶ms); | compress_user_cores_level, ¶ms); | ||||
if (params.comp == NULL) { | if (params.comp == NULL) { | ||||
error = EFAULT; | error = EFAULT; | ||||
goto done; | goto done; | ||||
} | } | ||||
tmpbuf = malloc(CORE_BUF_SIZE, M_TEMP, M_WAITOK | M_ZERO); | tmpbuf = malloc(CORE_BUF_SIZE, M_TEMP, M_WAITOK | M_ZERO); | ||||
▲ Show 20 Lines • Show All 1,126 Lines • Show Last 20 Lines |
So if global compress_user_cores is not set PT_COREDUMP cores are also uncompressed?