scoutfs: add key trace class

Some item tracing functions were really just tracing a key.  Refactor it
into a trace class with event users.  Later patches can then use the key
trace class.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-06-27 14:04:38 -07:00
parent e711c15acf
commit 94e78414f9
2 changed files with 13 additions and 17 deletions
+2 -2
View File
@@ -408,7 +408,7 @@ restart:
}
}
trace_scoutfs_item_insertion(sb, ins->key, ins->val);
trace_scoutfs_item_insertion(sb, ins->key);
rb_link_node(&ins->node, parent, node);
rb_insert_augmented(&ins->node, root, &scoutfs_item_rb_cb);
@@ -632,7 +632,7 @@ int scoutfs_item_lookup(struct super_block *sb, struct scoutfs_key_buf *key,
unsigned long flags;
int ret;
trace_scoutfs_item_lookup(sb, key, val);
trace_scoutfs_item_lookup(sb, key);
end = scoutfs_key_alloc(sb, SCOUTFS_MAX_KEY_SIZE);
if (!end) {
+11 -15
View File
@@ -204,10 +204,9 @@ TRACE_EVENT(scoutfs_manifest_add,
__entry->seq, __entry->level)
);
TRACE_EVENT(scoutfs_item_lookup,
TP_PROTO(struct super_block *sb, struct scoutfs_key_buf *key,
struct kvec *val),
TP_ARGS(sb, key, val),
DECLARE_EVENT_CLASS(scoutfs_key_class,
TP_PROTO(struct super_block *sb, struct scoutfs_key_buf *key),
TP_ARGS(sb, key),
TP_STRUCT__entry(
__dynamic_array(char, key, scoutfs_key_str(NULL, key))
),
@@ -217,17 +216,14 @@ TRACE_EVENT(scoutfs_item_lookup,
TP_printk("key %s", __get_str(key))
);
TRACE_EVENT(scoutfs_item_insertion,
TP_PROTO(struct super_block *sb, struct scoutfs_key_buf *key,
struct kvec *val),
TP_ARGS(sb, key, val),
TP_STRUCT__entry(
__dynamic_array(char, key, scoutfs_key_str(NULL, key))
),
TP_fast_assign(
scoutfs_key_str(__get_dynamic_array(key), key);
),
TP_printk("key %s", __get_str(key))
DEFINE_EVENT(scoutfs_key_class, scoutfs_item_lookup,
TP_PROTO(struct super_block *sb, struct scoutfs_key_buf *key),
TP_ARGS(sb, key)
);
DEFINE_EVENT(scoutfs_key_class, scoutfs_item_insertion,
TP_PROTO(struct super_block *sb, struct scoutfs_key_buf *key),
TP_ARGS(sb, key)
);
DECLARE_EVENT_CLASS(scoutfs_range_class,