do not use BPF_F_REUSE_STACKID incorrectly
Do not use BPF_F_REUSE_STACKID if the stack id is used
together with process specific info like
pid/tgid/comm. Using BPF_F_REUSE_STACKID may cause
stack id pointing to a different stack later on.
Signed-off-by: Yonghong Song <yhs@fb.com>
diff --git a/tools/trace.py b/tools/trace.py
index 1f4f589..0bd2861 100755
--- a/tools/trace.py
+++ b/tools/trace.py
@@ -487,12 +487,12 @@
if self.user_stack:
stack_trace += """
__data.user_stack_id = %s.get_stackid(
- %s, BPF_F_REUSE_STACKID | BPF_F_USER_STACK
+ %s, BPF_F_USER_STACK
);""" % (self.stacks_name, ctx_name)
if self.kernel_stack:
stack_trace += """
__data.kernel_stack_id = %s.get_stackid(
- %s, BPF_F_REUSE_STACKID
+ %s, 0
);""" % (self.stacks_name, ctx_name)
text = heading + """