Skip to contentSkip to conversation

Need help with tracepoints

DISCUSSION Matwey V. Kornilov 2 participants 4 messages Apr 29, 2017

lore
Share & tools
lore
#0 lore raw

Hello,

I am following trace/tracepoints.txt guide to add some tracepoints to already existing kernel module.

I've created include/trace/events/mysubsys.h
and added

#include <trace/events/mysubsys.h>

#define CREATE_TRACE_POINTS
DEFINE_TRACE(mysubsys_event1);
EXPORT_TRACEPOINT_SYMBOL_GPL(mysubsys_event1);

to the module sources. There are symbols *_mysubsys_event1 in module ko file.

The issue is that I don't see my events in /sys/kernel/debug/tracing/events Not even ./mysubsys path here.

#1 lore raw

Hello Matwey,

This doesn't answer your question, but did you take a look at perf and it's ability to do trace points?

See this link: http://www.brendangregg.com/perf.html#Tracepoints

Quoted 25 lines · Matwey V. Kornilov

Hello,

I am following trace/tracepoints.txt guide to add some tracepoints to already existing kernel module.

I've created include/trace/events/mysubsys.h
and added

#include <trace/events/mysubsys.h>

#define CREATE_TRACE_POINTS
DEFINE_TRACE(mysubsys_event1);
EXPORT_TRACEPOINT_SYMBOL_GPL(mysubsys_event1);

to the module sources. There are symbols *_mysubsys_event1 in module ko file.

The issue is that I don't see my events in /sys/kernel/debug/tracing/events Not even ./mysubsys path here.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Signature · 1 line
Peter
#2 lore raw
Quoted 6 lines · Peter Senna Tschudin

Hello Matwey,

This doesn't answer your question, but did you take a look at perf and it's ability to do trace points?

See this link: http://www.brendangregg.com/perf.html#Tracepoints

I actually meant this one here:

http://www.brendangregg.com/perf.html#DynamicTracingEg

Quoted 33 lines
Quoted 17 lines · Matwey V. Kornilov

Hello,

I am following trace/tracepoints.txt guide to add some tracepoints to already existing kernel module.

I've created include/trace/events/mysubsys.h
and added

#include <trace/events/mysubsys.h>

#define CREATE_TRACE_POINTS
DEFINE_TRACE(mysubsys_event1);
EXPORT_TRACEPOINT_SYMBOL_GPL(mysubsys_event1);

to the module sources. There are symbols *_mysubsys_event1 in module ko file.

Quoted 8 lines

The issue is that I don't see my events in /sys/kernel/debug/tracing/events Not even ./mysubsys path here.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

--
Peter

Signature · 1 line
Peter
#3 lore raw
In reply to Matwey V. Kornilov

29.04.2017 13:52, Matwey V. Kornilov ?????:

Quoted 14 lines

Hello,

I am following trace/tracepoints.txt guide to add some tracepoints to already existing kernel module.

I've created include/trace/events/mysubsys.h
and added

#include <trace/events/mysubsys.h>

#define CREATE_TRACE_POINTS
DEFINE_TRACE(mysubsys_event1);
EXPORT_TRACEPOINT_SYMBOL_GPL(mysubsys_event1);

Quoted 6 lines

to the module sources. There are symbols *_mysubsys_event1 in module ko file.

The issue is that I don't see my events in /sys/kernel/debug/tracing/events Not even ./mysubsys path here.

Ok. I found. I had to use TRACE_EVENT() macro to use /sys/kernel/debug/tracing/events interface