linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/13] trace: add the ability to parse sizeof()
@ 2017-06-14 22:27 Jeremy Linton
  2017-06-14 22:27 ` [PATCH v2 01/13] trace: rename kernel enum section to eval Jeremy Linton
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Jeremy Linton @ 2017-06-14 22:27 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, rostedt, mingo, rusty, jeyu, kirill.shutemov,
	christoffer.dall, marc.zyngier, jcm, clemens, perex

There are a few cases of sizeof() embedded in TRACE_EVENT()
macros. That is a problem because "sizeof(structure)" is
passed to userspace, which doesn't know how to decode the
size of kernel data structures. There was a similar problem
with enums.

Rather than recreating much of the enum infrastructure lets
simply extend it, and append additional symbols into the
enum_map that can translate string sizeof() calls into
values. Of course that means that much of the infrastructure
is now poorly named so we go through and replace instances
describing "enum" with "eval" to indicate a generic C
expression to numerical evaluation routine.

v1->v2:
  Modify the sample trace file to reflect a more reasonable example
  Add an additional TRACE_DEFINE_SIZEOF() for fjes_hw_request_info
  Add an additional patch to convert some hardcoded size values to sizeof

Jeremy Linton (13):
  trace: rename kernel enum section to eval
  trace: rename trace_enum_map to trace_eval_map
  trace: rename struct module entry for trace enums
  trace: rename trace enum data structures in trace.c
  trace: rename trace_enum_mutex to trace_eval_mutex
  trace: rename trace.c enum functions
  trace: rename enum_map functions
  tracing: Rename enum_replace to eval_replace
  tracing: define TRACE_DEFINE_SIZEOF() macro to map sizeof's to their
    values
  tracing: Update sample file to describe the new macro
  tracing: Add TRACE_DEFINE_SIZEOF() macros
  tracing: Replace some majic constants with sizeof()
  tracing: Rename and update the enum_map file

 arch/arm64/kvm/trace.h                         |   2 +
 drivers/net/fjes/fjes_trace.h                  |   2 +
 include/asm-generic/vmlinux.lds.h              |   6 +-
 include/linux/module.h                         |   4 +-
 include/linux/tracepoint.h                     |   7 +-
 include/trace/events/thermal.h                 |   4 +-
 include/trace/events/thermal_power_allocator.h |   4 +-
 include/trace/events/xen.h                     |  13 +-
 include/trace/trace_events.h                   |  26 +++-
 kernel/module.c                                |   6 +-
 kernel/trace/Kconfig                           |  22 +--
 kernel/trace/trace.c                           | 194 ++++++++++++-------------
 kernel/trace/trace.h                           |   4 +-
 kernel/trace/trace_events.c                    |  24 +--
 samples/trace_events/trace-events-sample.h     |  28 ++--
 sound/firewire/motu/amdtp-motu-trace.h         |  12 +-
 16 files changed, 202 insertions(+), 156 deletions(-)

-- 
2.9.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-06-14 22:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-14 22:27 [PATCH v2 00/13] trace: add the ability to parse sizeof() Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 01/13] trace: rename kernel enum section to eval Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 02/13] trace: rename trace_enum_map to trace_eval_map Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 03/13] trace: rename struct module entry for trace enums Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 04/13] trace: rename trace enum data structures in trace.c Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 05/13] trace: rename trace_enum_mutex to trace_eval_mutex Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 06/13] trace: rename trace.c enum functions Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 07/13] trace: rename enum_map functions Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 08/13] tracing: Rename enum_replace to eval_replace Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 09/13] tracing: define TRACE_DEFINE_SIZEOF() macro to map sizeof's to their values Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 10/13] tracing: Update sample file to describe the new macro Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 11/13] tracing: Add TRACE_DEFINE_SIZEOF() macros Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 12/13] tracing: Replace some magic constants with sizeof() Jeremy Linton
2017-06-14 22:27 ` [PATCH v2 13/13] tracing: Rename and update the enum_map file Jeremy Linton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).