X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Fjbd2.h;h=491a15a97d70683635c8cc1e2f4b4b4008ea687a;hb=290d1667a36ec7b568ca6acfec732ffd62b4e67f;hp=c7992c0e2a02452cb85d243b6ca6ac6bfaa989d6;hpb=253be6ef8104b27e65fbd634adcaa3fd947a9efb;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/jbd2.h b/instrumentation/events/lttng-module/jbd2.h index c7992c0e..491a15a9 100644 --- a/instrumentation/events/lttng-module/jbd2.h +++ b/instrumentation/events/lttng-module/jbd2.h @@ -1,19 +1,22 @@ #undef TRACE_SYSTEM #define TRACE_SYSTEM jbd2 -#if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) -#define _TRACE_JBD2_H +#if !defined(LTTNG_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) +#define LTTNG_TRACE_JBD2_H +#include "../../../probes/lttng-tracepoint-event.h" #include -#include +#include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) #ifndef _TRACE_JBD2_DEF #define _TRACE_JBD2_DEF struct transaction_chp_stats_s; struct transaction_run_stats_s; #endif +#endif -TRACE_EVENT(jbd2_checkpoint, +LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint, TP_PROTO(journal_t *journal, int result), @@ -33,7 +36,7 @@ TRACE_EVENT(jbd2_checkpoint, MAJOR(__entry->dev), MINOR(__entry->dev), __entry->result) ) -DECLARE_EVENT_CLASS(jbd2_commit, +LTTNG_TRACEPOINT_EVENT_CLASS(jbd2_commit, TP_PROTO(journal_t *journal, transaction_t *commit_transaction), @@ -56,35 +59,44 @@ DECLARE_EVENT_CLASS(jbd2_commit, __entry->transaction, __entry->sync_commit) ) -DEFINE_EVENT(jbd2_commit, jbd2_start_commit, +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_start_commit, + + TP_PROTO(journal_t *journal, transaction_t *commit_transaction), + + TP_ARGS(journal, commit_transaction) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_locking, TP_PROTO(journal_t *journal, transaction_t *commit_transaction), TP_ARGS(journal, commit_transaction) ) -DEFINE_EVENT(jbd2_commit, jbd2_commit_locking, +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_flushing, TP_PROTO(journal_t *journal, transaction_t *commit_transaction), TP_ARGS(journal, commit_transaction) ) -DEFINE_EVENT(jbd2_commit, jbd2_commit_flushing, +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_commit_logging, TP_PROTO(journal_t *journal, transaction_t *commit_transaction), TP_ARGS(journal, commit_transaction) ) -DEFINE_EVENT(jbd2_commit, jbd2_commit_logging, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT_INSTANCE(jbd2_commit, jbd2_drop_transaction, TP_PROTO(journal_t *journal, transaction_t *commit_transaction), TP_ARGS(journal, commit_transaction) ) +#endif -TRACE_EVENT(jbd2_end_commit, +LTTNG_TRACEPOINT_EVENT(jbd2_end_commit, TP_PROTO(journal_t *journal, transaction_t *commit_transaction), TP_ARGS(journal, commit_transaction), @@ -108,7 +120,7 @@ TRACE_EVENT(jbd2_end_commit, __entry->transaction, __entry->sync_commit, __entry->head) ) -TRACE_EVENT(jbd2_submit_inode_data, +LTTNG_TRACEPOINT_EVENT(jbd2_submit_inode_data, TP_PROTO(struct inode *inode), TP_ARGS(inode), @@ -128,7 +140,8 @@ TRACE_EVENT(jbd2_submit_inode_data, (unsigned long) __entry->ino) ) -TRACE_EVENT(jbd2_run_stats, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)) +LTTNG_TRACEPOINT_EVENT(jbd2_run_stats, TP_PROTO(dev_t dev, unsigned long tid, struct transaction_run_stats_s *stats), @@ -172,7 +185,7 @@ TRACE_EVENT(jbd2_run_stats, __entry->blocks_logged) ) -TRACE_EVENT(jbd2_checkpoint_stats, +LTTNG_TRACEPOINT_EVENT(jbd2_checkpoint_stats, TP_PROTO(dev_t dev, unsigned long tid, struct transaction_chp_stats_s *stats), @@ -202,8 +215,14 @@ TRACE_EVENT(jbd2_checkpoint_stats, jiffies_to_msecs(__entry->chp_time), __entry->forced_to_close, __entry->written, __entry->dropped) ) +#endif -TRACE_EVENT(jbd2_cleanup_journal_tail, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT(jbd2_update_log_tail, +#else +LTTNG_TRACEPOINT_EVENT(jbd2_cleanup_journal_tail, +#endif TP_PROTO(journal_t *journal, tid_t first_tid, unsigned long block_nr, unsigned long freed), @@ -231,8 +250,31 @@ TRACE_EVENT(jbd2_cleanup_journal_tail, __entry->tail_sequence, __entry->first_tid, __entry->block_nr, __entry->freed) ) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +LTTNG_TRACEPOINT_EVENT(jbd2_write_superblock, + + TP_PROTO(journal_t *journal, int write_op), + + TP_ARGS(journal, write_op), + + TP_STRUCT__entry( + __field( dev_t, dev ) + __field( int, write_op ) + ), + + TP_fast_assign( + tp_assign(dev, journal->j_fs_dev->bd_dev) + tp_assign(write_op, write_op) + ), + + TP_printk("dev %d,%d write_op %x", MAJOR(__entry->dev), + MINOR(__entry->dev), __entry->write_op) +) +#endif -#endif /* _TRACE_JBD2_H */ +#endif /* LTTNG_TRACE_JBD2_H */ /* This part must be outside protection */ #include "../../../probes/define_trace.h"