Skip to content

Commit

Permalink
#3058: Add tracy as a shared lib that we link everything against if E…
Browse files Browse the repository at this point in the history
…NABLE_TRACY=1
  • Loading branch information
tt-rkim committed Nov 29, 2023
1 parent 5aeb2c7 commit 1f1564b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 2 additions & 4 deletions module.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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 \
Expand Down
8 changes: 7 additions & 1 deletion tt_metal/tracy.mk
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 1f1564b

Please sign in to comment.