Skip to content

Commit

Permalink
增加lttng用户态挂载点
Browse files Browse the repository at this point in the history
  • Loading branch information
albertxu216 committed Sep 28, 2024
1 parent 6837aa5 commit 34a6f46
Show file tree
Hide file tree
Showing 2 changed files with 498 additions and 0 deletions.
257 changes: 257 additions & 0 deletions eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image/test/lock_tracepoint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@

#undef LTTNG_UST_TRACEPOINT_PROVIDER
#define LTTNG_UST_TRACEPOINT_PROVIDER lock_monitor

#undef LTTNG_UST_TRACEPOINT_INCLUDE
#define LTTNG_UST_TRACEPOINT_INCLUDE "/home/xhb/ospp/lock_tracepoint.h"

#if !defined(LOCK_TRACEPOINT_H) || defined(LTTNG_UST_TRACEPOINT_HEADER_MULTI_READ)
#define LOCK_TRACEPOINT_H

#include <lttng/tracepoint.h>

TRACEPOINT_EVENT(
lock_monitor,
mutex_lock_start,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
mutex_lock_acquired,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
mutex_lock_released,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
mutex_trylock_start,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
mutex_trylock_acquired,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
mutex_trylock_failed,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
rwlock_rdlock_start,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
rwlock_rdlock_acquired,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
rwlock_rdlock_released,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)
TRACEPOINT_EVENT(
lock_monitor,
rwlock_rdlock_failed,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
rwlock_wrlock_start,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
rwlock_wrlock_acquired,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
rwlock_wrlock_released,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
rwlock_wrlock_failed,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
spinlock_lock_start,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
spinlock_lock_acquired,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
spinlock_lock_released,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
spinlock_trylock_start,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
spinlock_trylock_acquired,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)

TRACEPOINT_EVENT(
lock_monitor,
spinlock_trylock_failed,
TP_ARGS(int, thread_id, void*, lock_ptr, long long unsigned int, time),
TP_FIELDS(
ctf_integer(int, thread_id, thread_id)
ctf_integer_hex(void*, lock_ptr, lock_ptr)
ctf_integer(long long unsigned int, time, time)
)
)
TRACEPOINT_LOGLEVEL(lock_monitor, mutex_lock_start, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, mutex_lock_acquired, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, mutex_lock_released, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, mutex_trylock_start, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, mutex_trylock_acquired, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, mutex_trylock_failed, TRACE_DEBUG)

TRACEPOINT_LOGLEVEL(lock_monitor, rwlock_rdlock_start, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, rwlock_rdlock_acquired, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, rwlock_rdlock_released, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, rwlock_rdlock_failed, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, rwlock_wrlock_start, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, rwlock_wrlock_acquired, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, rwlock_wrlock_released, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, rwlock_wrlock_failed, TRACE_DEBUG)

TRACEPOINT_LOGLEVEL(lock_monitor, spinlock_lock_start, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, spinlock_lock_acquired, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, spinlock_lock_released, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, spinlock_trylock_start, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, spinlock_trylock_acquired, TRACE_DEBUG)
TRACEPOINT_LOGLEVEL(lock_monitor, spinlock_trylock_failed, TRACE_DEBUG)


#endif /* LOCK_TRACEPOINT_H */

#include <lttng/tracepoint-event.h>
Loading

0 comments on commit 34a6f46

Please sign in to comment.