aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blktrace_api.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/blktrace_api.h')
-rw-r--r--include/linux/blktrace_api.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index d2e908586e3d..67b4d4dfc19c 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -28,10 +28,12 @@ struct blk_trace {
28 atomic_t dropped; 28 atomic_t dropped;
29}; 29};
30 30
31struct blkcg;
32
31extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); 33extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
32extern void blk_trace_shutdown(struct request_queue *); 34extern void blk_trace_shutdown(struct request_queue *);
33extern __printf(2, 3) 35extern __printf(3, 4)
34void __trace_note_message(struct blk_trace *, const char *fmt, ...); 36void __trace_note_message(struct blk_trace *, struct blkcg *blkcg, const char *fmt, ...);
35 37
36/** 38/**
37 * blk_add_trace_msg - Add a (simple) message to the blktrace stream 39 * blk_add_trace_msg - Add a (simple) message to the blktrace stream
@@ -46,12 +48,14 @@ void __trace_note_message(struct blk_trace *, const char *fmt, ...);
46 * NOTE: Can not use 'static inline' due to presence of var args... 48 * NOTE: Can not use 'static inline' due to presence of var args...
47 * 49 *
48 **/ 50 **/
49#define blk_add_trace_msg(q, fmt, ...) \ 51#define blk_add_cgroup_trace_msg(q, cg, fmt, ...) \
50 do { \ 52 do { \
51 struct blk_trace *bt = (q)->blk_trace; \ 53 struct blk_trace *bt = (q)->blk_trace; \
52 if (unlikely(bt)) \ 54 if (unlikely(bt)) \
53 __trace_note_message(bt, fmt, ##__VA_ARGS__); \ 55 __trace_note_message(bt, cg, fmt, ##__VA_ARGS__);\
54 } while (0) 56 } while (0)
57#define blk_add_trace_msg(q, fmt, ...) \
58 blk_add_cgroup_trace_msg(q, NULL, fmt, ##__VA_ARGS__)
55#define BLK_TN_MAX_MSG 128 59#define BLK_TN_MAX_MSG 128
56 60
57static inline bool blk_trace_note_message_enabled(struct request_queue *q) 61static inline bool blk_trace_note_message_enabled(struct request_queue *q)
@@ -82,6 +86,7 @@ extern struct attribute_group blk_trace_attr_group;
82# define blk_trace_startstop(q, start) (-ENOTTY) 86# define blk_trace_startstop(q, start) (-ENOTTY)
83# define blk_trace_remove(q) (-ENOTTY) 87# define blk_trace_remove(q) (-ENOTTY)
84# define blk_add_trace_msg(q, fmt, ...) do { } while (0) 88# define blk_add_trace_msg(q, fmt, ...) do { } while (0)
89# define blk_add_cgroup_trace_msg(q, cg, fmt, ...) do { } while (0)
85# define blk_trace_remove_sysfs(dev) do { } while (0) 90# define blk_trace_remove_sysfs(dev) do { } while (0)
86# define blk_trace_note_message_enabled(q) (false) 91# define blk_trace_note_message_enabled(q) (false)
87static inline int blk_trace_init_sysfs(struct device *dev) 92static inline int blk_trace_init_sysfs(struct device *dev)