RFC TRACE_EVENT: cleanup for code-size reduction
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest31 of 32 patches 24 repliesIn review
31 of 32 patches are in this archive. The cover letter announces 32.
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 2/32 | trace event sample remove semicolons, specify need for ifdef around declarationssamples/ | +13 | 1 reply | |
| 3/32 | trace event block remove semicolumnsinclude/ | +22 | 0 replies | |
| 4/32 | trace event ext4 remove semicolonsinclude/ | +74 | 0 replies | |
| 5/32 | trace event irq remove semicolonsinclude/ | +11 | 0 replies | |
| 6/32 | trace event jbd2 remove semicolonsinclude/ | +16 | 0 replies | |
| 7/32 | trace event kmem remove semicolonsinclude/ | +16 | 0 replies | |
| 8/32 | trace event kvm remove semicolonsarch/ arch/ arch/ +1 more | +63 | 0 replies | |
| 9/32 | trace event lock remove semicolonsinclude/ | +5 | 0 replies | |
| 10/32 | trace event mce remove semicolonsinclude/ | +1 | 0 replies | |
| 11/32 | trace event module remove semicolonsinclude/ | +11 | 0 replies | |
| 12/32 | trace event napi remove semicolonsinclude/ | +1 | 1 reply | |
| 13/32 | trace event net remove semicolonsinclude/ | +4 | 1 reply | |
| 14/32 | trace event power remove semicolonsinclude/ | +14 | 1 reply | |
| 15/32 | trace event sched remove trailing semicoloninclude/ | +41 | 0 replies | |
| 16/32 | trace event scsi remove semicolonsinclude/ | +11 | 0 replies | |
| 17/32 | trace event signal remove semicolonsinclude/ | +5 | 0 replies | |
| 18/32 | trace event skb remove semicolonsinclude/ | +3 | 1 reply | |
| 19/32 | trace event syscalls remove semicolonsinclude/ | +7 | 0 replies | |
| 20/32 | trace event timer remove semicolonsinclude/ | +14 | 0 replies | |
| 21/32 | trace event vmscan remove semicolonsinclude/ | +16 | 0 replies | |
| 22/32 | trace event workqueue remove semicolonsinclude/ | +5 | 1 reply | |
| 23/32 | trace event writeback remove semicolonsinclude/ | +29 | 0 replies | |
| 24/32 | trace event wireless remove semicolonsdrivers/ drivers/ net/ | +76 | 0 replies | |
| 25/32 | trace event video gpu remove semicolonsdrivers/ drivers/ | +29 | 0 replies | |
| 26/32 | trace event gfs2 remove semicolonsfs/ | +13 | 2 replies | |
| 27/32 | trace event xfs remove semicolonsfs/ | +272 | 0 replies | |
| 28/32 | trace event powerpc remove semicolonsarch/ arch/ | +18 | 0 replies | |
| 29/32 | trace event asoc remove semicolonsinclude/ | +22 | 10 replies | |
| 30/32 | trace event compaction remove semicolonsinclude/ | +4 | 0 replies | |
| 31/32 | trace event regulator remove semicolonsinclude/ | +10 | 1 reply | |
| 32/32 | trace event btrfs remove semicolonsinclude/ | +31 | 0 replies |
Reviews trailers per patch
8 of 31 patches have a Reviewed-by or Acked-by.
| Patch | Steven Whitehouse | Tejun Heo | Neil Horman | [email protected] | Mark Brown |
|---|---|---|---|---|---|
| 2/32 | |||||
| 3/32 | |||||
| 4/32 | |||||
| 5/32 | |||||
| 6/32 | |||||
| 7/32 | |||||
| 8/32 | |||||
| 9/32 | |||||
| 10/32 | |||||
| 11/32 | |||||
| 12/32 | A-b | ||||
| 13/32 | A-b | ||||
| 14/32 | A-b | ||||
| 15/32 | |||||
| 16/32 | |||||
| 17/32 | |||||
| 18/32 | A-b | ||||
| 19/32 | |||||
| 20/32 | |||||
| 21/32 | |||||
| 22/32 | A-b A-b | ||||
| 23/32 | |||||
| 24/32 | |||||
| 25/32 | |||||
| 26/32 | A-b | ||||
| 27/32 | |||||
| 28/32 | |||||
| 29/32 | A-b | ||||
| 30/32 | |||||
| 31/32 | A-b | ||||
| 32/32 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.
Cover letter [RFC patch 00/32] TRACE_EVENT: cleanup for code-size reduction
Hi,
I implemented the TRACE_EVENT macros as arrays of fields and arrays of events in LTTng, and realised that it could benefit Ftrace too by cutting down its code size. As I know that code size footprint is an issue Steven has been wanting to tackle for a while, I am sending this "semicolon removal" patchset, which is a prerequisite to be able to generate arrays of events.
The main difference between the approaches Ftrace and LTTng have taken is that Ftrace creates a "ftrace_define_fields_##call" function for each event which calls trace_define_field for each field of each event. In LTTng, I did the following (code snippet from [1]):
struct lttng_event_field {
const char *name;
const struct lttng_type type;
};struct lttng_event_desc {
const struct lttng_event_field *fields;
const char *name;
unsigned int nr_fields;
};#undef DEFINE_EVENT
#define DEFINE_EVENT(_template, _name, _proto, _args) \
{ \
.fields = __event_fields___##_template, \
.name = #_name, \
.nr_fields = ARRAY_SIZE(__event_fields___##_template), \
},#define TP_ID1(_token, _system) _token##_system #define TP_ID(_token, _system) TP_ID1(_token, _system)
static const struct lttng_event_desc TP_ID(__event_desc___, TRACE_SYSTEM)[] = { #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
};
And for creation of __event_fields___##_template, which allows to keep all fields in another array (which should be defined in a phase prior to the event array definition), I did:
#undef __field
#define __field(_type, _item) \
{ .name = #_item, .type = { .atype = atype_integer, .name = #_type} },(similar for __field_ext, __array, __dynamic_array, __string)
#undef TP_STRUCT__entry
#define TP_STRUCT__entry(args...) args /* Only one used in this phase */
#undef DECLARE_EVENT_CLASS
#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \
static const struct lttng_event_field __event_fields___##_name[] = { \
_tstruct \
};For the declaration of struct lttng_type, which contains the field type information in a union, see [2].
Best regards,
Mathieu
[1] http://git.lttng.org/?p=lttng-modules.git;a=blob;f=probes/lttng-events.h;h=a05c29d56771b89807ffef035b7cd6df34a0b97f;hb=HEAD
[2] http://git.lttng.org/?p=lttng-modules.git;a=blob;f=probes/lttng-types.h;h=0192bffaf2f321f446f71a13901e2ab09fd69663;hb=HEAD
Signature · 4 lines
Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com