Skip to content

Commit 91d6e85

Browse files
art049claude
andcommitted
fix(tracegrind): stop auto-appending .msgpack.lz4 extension to output file
The output file path is now used exactly as specified by --tracegrind-out-file. The default format includes the extension so the default behavior is unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 515925b commit 91d6e85

21 files changed

Lines changed: 20 additions & 27 deletions

tracegrind/clo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ void TG_(print_usage)(void)
505505
{
506506
VG_(printf)(
507507
"\n output options:\n"
508-
" --tracegrind-out-file=<f> Output file name [tracegrind.out.%%p]\n"
508+
" --tracegrind-out-file=<f> Output file name [tracegrind.out.%%p.msgpack.lz4]\n"
509509

510510
"\n data collection options:\n"
511511
" --instr-atstart=no|yes Do instrumentation at tracegrind start [yes]\n"

tracegrind/docs/tracegrind-msgpack-format.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
Tracegrind produces a binary trace file combining MsgPack serialization with LZ4 block compression. Files use the `.msgpack.lz4` extension.
5+
Tracegrind produces a binary trace file combining MsgPack serialization with LZ4 block compression. The default output file name is `tracegrind.out.<pid>.msgpack.lz4`.
66

77
## File Structure
88

tracegrind/dump.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,6 @@ void TG_(trace_open_output)(void)
406406
filename[sizeof(filename) - 1] = '\0';
407407
VG_(free)(expanded);
408408

409-
/* Append .msgpack.lz4 suffix */
410-
SizeT len = VG_(strlen)(filename);
411-
if (len + 12 < sizeof(filename)) {
412-
VG_(strncpy)(filename + len, ".msgpack.lz4", sizeof(filename) - len - 1);
413-
filename[sizeof(filename) - 1] = '\0';
414-
}
415-
416409
res = VG_(open)(filename,
417410
VKI_O_CREAT|VKI_O_WRONLY|VKI_O_TRUNC,
418411
VKI_S_IRUSR|VKI_S_IWUSR);

tracegrind/global.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
/*--- Command line options ---*/
6868
/*------------------------------------------------------------*/
6969

70-
#define DEFAULT_OUTFORMAT "tracegrind.out.%p"
70+
#define DEFAULT_OUTFORMAT "tracegrind.out.%p.msgpack.lz4"
7171

7272
/* If and how to collect syscall time.
7373
systime_no : do not collect systime

tracegrind/tests/test_basic.vgtest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
prereq: ../../tracegrind/scripts/tracegrind-analyzer --help 2>/dev/null
22
prog: test_basic.bin
3-
vgopts: --tracegrind-out-file=tracegrind.out.test_basic
3+
vgopts: --tracegrind-out-file=tracegrind.out.test_basic.msgpack.lz4
44
post: ../../tracegrind/scripts/tracegrind-analyzer tracegrind.out.test_basic.msgpack.lz4 --stats | ./filter_trace
55
cleanup: rm -f tracegrind.out.test_basic.msgpack.lz4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
prereq: ../../tracegrind/scripts/tracegrind-analyzer --help 2>/dev/null
22
prog: test_enter_inlined.bin
3-
vgopts: --tracegrind-out-file=tracegrind.out.test_enter_inlined --instr-atstart=no --read-inline-info=yes
3+
vgopts: --tracegrind-out-file=tracegrind.out.test_enter_inlined.msgpack.lz4 --instr-atstart=no --read-inline-info=yes
44
post: ../../tracegrind/scripts/tracegrind-analyzer tracegrind.out.test_enter_inlined.msgpack.lz4 | ./filter_trace
55
cleanup: rm -f tracegrind.out.test_enter_inlined.msgpack.lz4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
prereq: ../../tracegrind/scripts/tracegrind-analyzer --help 2>/dev/null
22
prog: test_exception.bin
3-
vgopts: --tracegrind-out-file=tracegrind.out.test_exception --instr-atstart=no
3+
vgopts: --tracegrind-out-file=tracegrind.out.test_exception.msgpack.lz4 --instr-atstart=no
44
post: ../../tracegrind/scripts/tracegrind-analyzer tracegrind.out.test_exception.msgpack.lz4 | ./filter_trace | grep -E '(Format |Schema |Event Schemas|Showing |MARKER|fn=catcher|fn=thrower|fn=do_throw)'
55
cleanup: rm -f tracegrind.out.test_exception.msgpack.lz4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
prereq: ../../tracegrind/scripts/tracegrind-analyzer --help 2>/dev/null
22
prog: test_foo_bar_baz.bin
3-
vgopts: --tracegrind-out-file=tracegrind.out.test_foo_bar_baz --instr-atstart=no
3+
vgopts: --tracegrind-out-file=tracegrind.out.test_foo_bar_baz.msgpack.lz4 --instr-atstart=no
44
post: ../../tracegrind/scripts/tracegrind-analyzer tracegrind.out.test_foo_bar_baz.msgpack.lz4 | ./filter_trace
55
cleanup: rm -f tracegrind.out.test_foo_bar_baz.msgpack.lz4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
prereq: ../../tracegrind/scripts/tracegrind-analyzer --help 2>/dev/null
22
prog: test_inline.bin
3-
vgopts: --tracegrind-out-file=tracegrind.out.test_inline --instr-atstart=no
3+
vgopts: --tracegrind-out-file=tracegrind.out.test_inline.msgpack.lz4 --instr-atstart=no
44
post: ../../tracegrind/scripts/tracegrind-analyzer tracegrind.out.test_inline.msgpack.lz4 | ./filter_trace
55
cleanup: rm -f tracegrind.out.test_inline.msgpack.lz4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
prereq: ../../tracegrind/scripts/tracegrind-analyzer --help 2>/dev/null
22
prog: test_instr_toggle.bin
3-
vgopts: --tracegrind-out-file=tracegrind.out.test_instr_toggle --instr-atstart=no
3+
vgopts: --tracegrind-out-file=tracegrind.out.test_instr_toggle.msgpack.lz4 --instr-atstart=no
44
post: ../../tracegrind/scripts/tracegrind-analyzer tracegrind.out.test_instr_toggle.msgpack.lz4 | ./filter_trace
55
cleanup: rm -f tracegrind.out.test_instr_toggle.msgpack.lz4

0 commit comments

Comments
 (0)