[SOLVED] echo 1 > /sys/kernel/debug/tracing/events/enable has no effect
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Oh, sorry. I just realized it doesnt work if there is no trace point set. Not sure why it is designed so, but it seems unless there is at least 1 trace point set, it ignores the enable..
So, if I did add tracepoint before doing this by: echo 'p:func_entry test:0x332' > /sys/kernel/debug/tracing/uprobe_events
After making multiple efforts, adding trace points and enabling uprobe, I couldn't see any thing in the trace file:
(Does this work only if the kernel has been built with specfic options (apart from the default enabled 'kernel debugging option'))
The issue was actually due to not enabling /sys/kernel/debug/tracing/events/enable which is master enable. What I enabled earlier was .../events/uprobes/enable.
Shouldn't matter. I ran a quick test before I replied yesterday using that test.c and enabled .../events/uprobes/enable and it all ran fine.
I don't usually use uprobes, but the entire tracing framework is a little like topsy - bits have been added over time and there are some "interesting" nuances in how different things work in practice. Guess we users just have to live with it.
Glad you got it working.
root@bbr:/home/bbr/xxxxxxxxxxxxxxx/out# grep -i [ku]probe /boot/config-$(uname -r)
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_KPROBES=y
CONFIG_KPROBES_ON_FTRACE=y
CONFIG_UPROBES=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KPROBES_ON_FTRACE=y
CONFIG_KPROBE_EVENT=y
CONFIG_UPROBE_EVENT=y
# CONFIG_KPROBES_SANITY_TEST is not set
I tried uprobes enabling again as per your response. As you mentioned, I realized that setting '...events/uprobes/enable' to 1 is enough, without manually setting '....events/enable' to 1. The trace log is getting overwritten by latest data ('....tracing/trace'), so I could not figure out my trace point was in log, when I did in my previous post above. Any way, I can increase the buffer size or control this behaviour?
Now, another observation I did (posted just another question per this) is '..events/enable' is getting set to 'X' when I try to set it to '1' from '0'. It seems to indicate it is enabled when its value is 'X'... and not enabled indicated as '0'. Why is it 'X' instead of '1'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.