Skip to content

Commit 6fd57d5

Browse files
art049claude
andcommitted
feat: fork callgrind as tracegrind (mechanical rename)
Pure copy of callgrind/ to tracegrind/ with symbol prefix rename CLG_ → TG_ (expanding to vgTracegrind_), header guards updated, public header renamed to tracegrind.h with TRACEGRIND_* macros. No behavioral changes — output is still identical to callgrind. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3b88c88 commit 6fd57d5

22 files changed

Lines changed: 12181 additions & 0 deletions

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ TOOLS = \
99
memcheck \
1010
cachegrind \
1111
callgrind \
12+
tracegrind \
1213
helgrind \
1314
drd \
1415
massif \

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5807,6 +5807,8 @@ AC_CONFIG_FILES([
58075807
callgrind/callgrind_annotate
58085808
callgrind/callgrind_control
58095809
callgrind/tests/Makefile
5810+
tracegrind/Makefile
5811+
tracegrind/tests/Makefile
58105812
helgrind/Makefile
58115813
helgrind/tests/Makefile
58125814
drd/Makefile

tracegrind/Makefile.am

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
include $(top_srcdir)/Makefile.tool.am
2+
3+
EXTRA_DIST =
4+
5+
#----------------------------------------------------------------------------
6+
# Headers, etc
7+
#----------------------------------------------------------------------------
8+
9+
pkginclude_HEADERS = tracegrind.h
10+
11+
noinst_HEADERS = \
12+
costs.h \
13+
events.h \
14+
global.h
15+
16+
#----------------------------------------------------------------------------
17+
# tracegrind-<platform>
18+
#----------------------------------------------------------------------------
19+
20+
noinst_PROGRAMS = tracegrind-@VGCONF_ARCH_PRI@-@VGCONF_OS@
21+
if VGCONF_HAVE_PLATFORM_SEC
22+
noinst_PROGRAMS += tracegrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@
23+
endif
24+
25+
TRACEGRIND_SOURCES_COMMON = \
26+
bb.c \
27+
bbcc.c \
28+
callstack.c \
29+
clo.c \
30+
context.c \
31+
costs.c \
32+
debug.c \
33+
dump.c \
34+
events.c \
35+
fn.c \
36+
jumps.c \
37+
main.c \
38+
sim.c \
39+
threads.c
40+
41+
# We sneakily include "cg_branchpred.c" and "cg_arch.c" from cachegrind
42+
TRACEGRIND_CFLAGS_COMMON = -I$(top_srcdir)/cachegrind
43+
44+
tracegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES = \
45+
$(TRACEGRIND_SOURCES_COMMON)
46+
tracegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CPPFLAGS = \
47+
$(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
48+
tracegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \
49+
$(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) $(TRACEGRIND_CFLAGS_COMMON)
50+
tracegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_DEPENDENCIES = \
51+
$(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@)
52+
tracegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDADD = \
53+
$(TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@)
54+
tracegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS = \
55+
$(TOOL_LDFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
56+
tracegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LINK = \
57+
$(top_builddir)/coregrind/link_tool_exe_@VGCONF_OS@ \
58+
@VALT_LOAD_ADDRESS_PRI@ \
59+
$(LINK) \
60+
$(tracegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_CFLAGS) \
61+
$(tracegrind_@VGCONF_ARCH_PRI@_@VGCONF_OS@_LDFLAGS)
62+
63+
if VGCONF_HAVE_PLATFORM_SEC
64+
tracegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_SOURCES = \
65+
$(TRACEGRIND_SOURCES_COMMON)
66+
tracegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CPPFLAGS = \
67+
$(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
68+
tracegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS = $(LTO_CFLAGS) \
69+
$(AM_CFLAGS_@VGCONF_PLATFORM_SEC_CAPS@) $(TRACEGRIND_CFLAGS_COMMON)
70+
tracegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_DEPENDENCIES = \
71+
$(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@)
72+
tracegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDADD = \
73+
$(TOOL_LDADD_@VGCONF_PLATFORM_SEC_CAPS@)
74+
tracegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS = \
75+
$(TOOL_LDFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
76+
tracegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LINK = \
77+
$(top_builddir)/coregrind/link_tool_exe_@VGCONF_OS@ \
78+
@VALT_LOAD_ADDRESS_SEC@ \
79+
$(LINK) \
80+
$(tracegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_CFLAGS) \
81+
$(tracegrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_LDFLAGS)
82+
endif

0 commit comments

Comments
 (0)