From 1f1564be9d0444daa95b3331bcebe01d3f57cf43 Mon Sep 17 00:00:00 2001 From: Raymond Kim Date: Tue, 28 Nov 2023 19:16:00 +0000 Subject: [PATCH] #3058: Add tracy as a shared lib that we link everything against if ENABLE_TRACY=1 --- module.mk | 6 ++---- tt_metal/tracy.mk | 8 +++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/module.mk b/module.mk index abab506a591..1aa70a2de57 100644 --- a/module.mk +++ b/module.mk @@ -123,7 +123,7 @@ endif ifeq ($(ENABLE_TRACY), 1) CFLAGS += -DTRACY_ENABLE -fno-omit-frame-pointer -fPIC -LDFLAGS += -rdynamic +LDFLAGS += -ltracy -rdynamic endif LIBS_TO_BUILD = @@ -135,11 +135,9 @@ LIBS_TO_BUILD += \ endif LIBS_TO_BUILD += \ - common \ - build_kernels_for_riscv \ + tracy \ set_up_kernels \ umd_device \ - llrt \ tools \ tt_metal \ tracy \ diff --git a/tt_metal/tracy.mk b/tt_metal/tracy.mk index 22ce64798bc..36b31019856 100644 --- a/tt_metal/tracy.mk +++ b/tt_metal/tracy.mk @@ -1,4 +1,6 @@ +TRACY_LIB = $(LIBDIR)/libtracy.so TRACY_INCLUDES = -I$(TT_METAL_HOME)/tt_metal/third_party/tracy/public/tracy/ +TRACY_LDFLAGS = $(LDFLAGS) TRACY_DEFINES = -DTRACY_NO_CONTEXT_SWITCH #TRACY_DEFINES = -DTRACY_SAMPLING_HZ=40000 -DTRACY_NO_SYSTEM_TRACING -DTRACY_NO_CALLSTACK -DTRACY_NO_CALLSTACK_INLINES @@ -10,7 +12,11 @@ TRACY_DEPS = $(addprefix $(OBJDIR)/, $(TRACY_SRCS:.cpp=.d)) -include $(TRACY_DEPS) -tracy: $(TRACY_OBJS) +tracy: $(TRACY_LIB) + +$(TRACY_LIB): $(TRACY_OBJS) + @mkdir -p $(LIBDIR) + $(CXX) $(CFLAGS) $(CXXFLAGS) $(SHARED_LIB_FLAGS) -o $@ $^ $(TRACY_LDFLAGS) $(OBJDIR)/tt_metal/third_party/tracy/public/%.o: tt_metal/third_party/tracy/public/%.cpp @mkdir -p $(@D)