1 // SPDX-License-Identifier: LGPL-2.1
3 * Copyright (C) 2010 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
9 #include "event-parse.h"
10 #include "trace-seq.h"
13 #define MINORMASK ((1U << MINORBITS) - 1)
15 #define MAJOR(dev) ((unsigned int) ((dev) >> MINORBITS))
16 #define MINOR(dev) ((unsigned int) ((dev) & MINORMASK))
18 static unsigned long long
19 process_jbd2_dev_to_name(struct trace_seq
*s
, unsigned long long *args
)
21 unsigned int dev
= args
[0];
23 trace_seq_printf(s
, "%d:%d", MAJOR(dev
), MINOR(dev
));
27 static unsigned long long
28 process_jiffies_to_msecs(struct trace_seq
*s
, unsigned long long *args
)
30 unsigned long long jiffies
= args
[0];
32 trace_seq_printf(s
, "%lld", jiffies
);
36 int TEP_PLUGIN_LOADER(struct tep_handle
*tep
)
38 tep_register_print_function(tep
,
39 process_jbd2_dev_to_name
,
45 tep_register_print_function(tep
,
46 process_jiffies_to_msecs
,
54 void TEP_PLUGIN_UNLOADER(struct tep_handle
*tep
)
56 tep_unregister_print_function(tep
, process_jbd2_dev_to_name
,
59 tep_unregister_print_function(tep
, process_jiffies_to_msecs
,