Skip to content

Commit

Permalink
tracing: Add TRACE_DEFINE_SIZEOF() macros
Browse files Browse the repository at this point in the history
There are a few places in the kernel where sizeof() is already
being used. Update those locations with TRACE_DEFINE_SIZEOF.

Link: http://lkml.kernel.org/r/20170531215653.3240-12-jeremy.linton@arm.com

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Jeremy Linton authored and Steven Rostedt (VMware) committed Jun 13, 2017
1 parent 4f0dfd7 commit ff910cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions arch/arm64/kvm/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ TRACE_EVENT(kvm_arm_set_dreg32,
TP_printk("%s: 0x%08x", __entry->name, __entry->value)
);

TRACE_DEFINE_SIZEOF(__u64);

TRACE_EVENT(kvm_arm_set_regset,
TP_PROTO(const char *type, int len, __u64 *control, __u64 *value),
TP_ARGS(type, len, control, value),
Expand Down
13 changes: 11 additions & 2 deletions include/trace/events/xen.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ DECLARE_EVENT_CLASS(xen_mc__batch,
DEFINE_XEN_MC_BATCH(xen_mc_batch);
DEFINE_XEN_MC_BATCH(xen_mc_issue);

TRACE_DEFINE_SIZEOF(ulong);

TRACE_EVENT(xen_mc_entry,
TP_PROTO(struct multicall_entry *mc, unsigned nargs),
TP_ARGS(mc, nargs),
Expand All @@ -40,8 +42,8 @@ TRACE_EVENT(xen_mc_entry,
),
TP_fast_assign(__entry->op = mc->op;
__entry->nargs = nargs;
memcpy(__entry->args, mc->args, sizeof(unsigned long) * nargs);
memset(__entry->args + nargs, 0, sizeof(unsigned long) * (6 - nargs));
memcpy(__entry->args, mc->args, sizeof(ulong) * nargs);
memset(__entry->args + nargs, 0, sizeof(ulong) * (6 - nargs));
),
TP_printk("op %u%s args [%lx, %lx, %lx, %lx, %lx, %lx]",
__entry->op, xen_hypercall_name(__entry->op),
Expand Down Expand Up @@ -122,6 +124,7 @@ TRACE_EVENT(xen_mc_extend_args,
__entry->res == XEN_MC_XE_NO_SPACE ? "NO_SPACE" : "???")
);

TRACE_DEFINE_SIZEOF(pteval_t);
/* mmu */
DECLARE_EVENT_CLASS(xen_mmu__set_pte,
TP_PROTO(pte_t *ptep, pte_t pteval),
Expand Down Expand Up @@ -199,6 +202,8 @@ TRACE_EVENT(xen_mmu_pte_clear,
__entry->mm, __entry->addr, __entry->ptep)
);

TRACE_DEFINE_SIZEOF(pmdval_t);

TRACE_EVENT(xen_mmu_set_pmd,
TP_PROTO(pmd_t *pmdp, pmd_t pmdval),
TP_ARGS(pmdp, pmdval),
Expand Down Expand Up @@ -226,6 +231,8 @@ TRACE_EVENT(xen_mmu_pmd_clear,

#if CONFIG_PGTABLE_LEVELS >= 4

TRACE_DEFINE_SIZEOF(pudval_t);

TRACE_EVENT(xen_mmu_set_pud,
TP_PROTO(pud_t *pudp, pud_t pudval),
TP_ARGS(pudp, pudval),
Expand All @@ -241,6 +248,8 @@ TRACE_EVENT(xen_mmu_set_pud,
(int)sizeof(pudval_t) * 2, (unsigned long long)__entry->pudval)
);

TRACE_DEFINE_SIZEOF(p4dval_t);

TRACE_EVENT(xen_mmu_set_p4d,
TP_PROTO(p4d_t *p4dp, p4d_t *user_p4dp, p4d_t p4dval),
TP_ARGS(p4dp, user_p4dp, p4dval),
Expand Down

0 comments on commit ff910cf

Please sign in to comment.