2

I've tried these, but all of them produce "empty" output files:

trace-cmd record -p function_graph -g munmap -F ls
trace-cmd record -p function_graph -g sys_enter_munmap -F ls
trace-cmd record -p function_graph -g sys_enter -F ls
7
  • Are you sure ftrace is enabled? Commented Apr 9, 2011 at 17:49
  • Yeah, it works if I just tell it to dump all events. Commented Apr 9, 2011 at 19:09
  • Well, I tried these and they work here (Ubuntu 2.6.35-28,trace-cmd version 1.0.3 ) so I would guess the problem lies in your specific kernel or ftrace-cmd version and/or config. Commented Apr 10, 2011 at 6:58
  • What command did you use to view the output? What kind of output did you get? Commented Apr 10, 2011 at 7:05
  • 1
    hmm... seems something is fishy indeed. I tried now the command: " trace-cmd record -p function_graph -g xxx -F ls " And it seems to produce the same output. I don't think the filtering works... :-) Commented Apr 10, 2011 at 7:37

1 Answer 1

3

First you need to get the function name right - e.g. the function name to use for tracing open syscalls is sys_open.

To do this the "proper" way, it's necessary to have function_graph support in the kernel. On the x86 architecture this depends on CC_OPTIMIZE_FOR_SIZE being disabled, but on x86_64 it doesn't.

In my case I didn't bother to compile a custom kernel to disable CC_OPTIMIZE_FOR_SIZE, I just did

trace-cmd record -p function --func-stack

and included various functions that looked like they might be called by adding several -l options. This was enough to figure out what I wanted to know.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.