amp switchrate to avoid Dtrace buffer filling up with 'bunyan -p ...'

This commit is contained in:
Trent Mick 2013-05-17 02:08:05 -07:00
parent 1514b25fb9
commit 3fb3f23834
2 changed files with 12 additions and 1 deletions

View file

@ -8,7 +8,17 @@ Known issues:
## bunyan 0.21.2 (not yet released) ## bunyan 0.21.2 (not yet released)
(nothing yet) - Avoid Dtrace buffer filling up, e.g. like this:
$ bunyan -p 42241 > /tmp/all.log
dtrace: error on enabled probe ID 3 (ID 75795: bunyan42241:mod-87ea640:log-trace:log-trace): out of scratch space in action #1 at DIF offset 12
dtrace: error on enabled probe ID 3 (ID 75795: bunyan42241:mod-87ea640:log-trace:log-trace): out of scratch space in action #1 at DIF offset 12
dtrace: 138 drops on CPU 4
...
From Bryan: "the DTrace buffer is filling up because the string size is so
large... by increasing the switchrate, you're increasing the rate at
which that buffer is emptied."
## bunyan 0.21.1 ## bunyan 0.21.1

View file

@ -1105,6 +1105,7 @@ function processPids(opts, stylize, callback) {
return format('bunyan%s:::log-*', pid); return format('bunyan%s:::log-*', pid);
}).join(','); }).join(',');
var argv = ['dtrace', '-Z', '-x', 'strsize=4k', '-qn', var argv = ['dtrace', '-Z', '-x', 'strsize=4k', '-qn',
'-x', 'switchrate=10hz',
format('%s{printf("%s", copyinstr(arg0))}', probes)]; format('%s{printf("%s", copyinstr(arg0))}', probes)];
//console.log('dtrace argv: %s', argv); //console.log('dtrace argv: %s', argv);
var dtrace = spawn(argv[0], argv.slice(1), var dtrace = spawn(argv[0], argv.slice(1),