7

I was tying to use perf on Renesas target and I configured the yocto "local.conf" as showed in this link.

#avoid stripping binaries 
INHIBIT_PACKAGE_STRIP = "1"

#add the debug information
EXTRA_IMAGE_FEATURES= "debug-tweaks tools-debug dbg-pkgs tools-profile"

#format the debug info into a readable format for PERF
PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'

perf is working but I need to monitor the context switches which require to use perf timechart and other commands that depends on perf-events, but the commands can't find this path "/sys/kernel/debug/tracing/events" .

What should I do in order to get this folder and its files compiled with my kernel?

3 Answers 3

8

You probably need to mount the debugfs filesystem:

mount -t debugfs none /sys/kernel/debug

If you already have a startup script of your own in /etc/init.d/ it should be possible to add it there, or you might add it to /etc/fstab as

debugfs /sys/kernel/debug debugfs defaults
7
  • 1
    this folder already mounted but the debug folder have no folders named events
    – gemad
    Commented Jul 10, 2017 at 9:41
  • Did your kernel get compiled with CONFIG_PERF_EVENTS=y ?
    – meuh
    Commented Jul 10, 2017 at 10:06
  • where should i add this option ?
    – gemad
    Commented Jul 10, 2017 at 10:08
  • Did you check if it is already there? If not yocto has its own way complex way of handling the kernel config. You need to look for examples of creating your own .bbappend recipe in recipes-kernel to add the line CONFIG_PERF_EVENTS=y to ${B}/.config and run yes '' | oe_runmake oldconfig.
    – meuh
    Commented Jul 10, 2017 at 14:20
  • 1
    I did so and recompiled , but still th events folder not exist at the debug folder , only those files and folders do , { asoc, dri, hid, pm_qos, sleep_time, bdi, extfrag, memblock, pwm, suspend_stats, clk , fault_around_bytes, mmc0, regmap ,usb, debug_enabled, gcov, opp, regulator, virtio-ports, dma_buf, gpio, pinctrl, sched_features, wakeup_sources }
    – gemad
    Commented Jul 11, 2017 at 7:32
2

I found an answer for this exact same problem I had here.

The steps to fully 'activate' ftrace on the Linux kernel are:

  • bitbake -c menuconfig linux-imx (the target is going to be different for each board so you have to look it up)
  • Then from the menu choose 'Kernel Hacking' -> Tracers. Type 'Y' to activate.
  • Go into the Tracers sub-directory and enable 'Function Tracers' (this also enables 'Function Graph Tracers'.
  • Save the config file, overwriting your current one, and rebuild.
0

In my case, with yocto and a 5.10 kernel, the proper kernel config options were enabled. However, only /sys/kernel/tracing was mounted, and the path /sys/kernel/debug/tracing (which should be mounted for backwards compatibility when debugfs is mounted according to the doc) was missing, because of the option CONFIG_TRACEFS_DISABLE_AUTOMOUNT=y.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .