scoutfs: replace trace_printk in xattr.c

Signed-off-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
Mark Fasheh
2017-09-20 16:43:44 -05:00
committed by Mark Fasheh
parent 87adeb9306
commit 7739a0084e
2 changed files with 29 additions and 2 deletions

View File

@@ -36,6 +36,33 @@
#define FSID_ARG(sb) le64_to_cpu(SCOUTFS_SB(sb)->super.hdr.fsid)
#define FSID_FMT "%llx"
TRACE_EVENT(scoutfs_xattr_set,
TP_PROTO(struct super_block *sb, size_t name_len, const void *value,
size_t size, int flags),
TP_ARGS(sb, name_len, value, size, flags),
TP_STRUCT__entry(
__field(__u64, fsid)
__field(size_t, name_len)
__field(const void *, value)
__field(size_t, size)
__field(int, flags)
),
TP_fast_assign(
__entry->fsid = FSID_ARG(sb);
__entry->name_len = name_len;
__entry->value = value;
__entry->size = size;
__entry->flags = flags;
),
TP_printk(FSID_FMT" name_len %zu value %p size %zu flags 0x%x",
__entry->fsid, __entry->name_len, __entry->value,
__entry->size, __entry->flags)
);
TRACE_EVENT(scoutfs_manifest_next_compact,
TP_PROTO(struct super_block *sb, int level),

View File

@@ -24,6 +24,7 @@
#include "trans.h"
#include "xattr.h"
#include "lock.h"
#include "scoutfs_trace.h"
/*
* In the simple case an xattr is stored in a single item whose key and
@@ -271,8 +272,7 @@ static int scoutfs_xattr_set(struct dentry *dentry, const char *name,
int sif;
int ret;
trace_printk("name_len %zu value %p size %zu flags 0x%x\n",
name_len, value, size, flags);
trace_scoutfs_xattr_set(sb, name_len, value, size, flags);
if (name_len > SCOUTFS_XATTR_MAX_NAME_LEN ||
(value && size > SCOUTFS_XATTR_MAX_SIZE))