Skip to content

Commit

Permalink
tracing/events: change the type of __str_loc_item to unsigned short
Browse files Browse the repository at this point in the history
When defining a dynamic size string, we add __str_loc_##item to the
trace entry, and it stores the location of the actual string in
entry->_str_data[]

'unsigned short' should be sufficient to store this information, thus
we save 2 bytes per dyn-size string in the ring buffer.

[ Impact: reduce memory occupied by dyn-size strings in ring buffer ]

Signed-off-by: Li Zefan <[email protected]>
Cc: Steven Rostedt <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
  • Loading branch information
Li Zefan authored and fweisbec committed May 25, 2009
1 parent 4f53596 commit b0aae68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/trace/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define __field(type, item) type item;

#undef __string
#define __string(item, src) int __str_loc_##item;
#define __string(item, src) unsigned short __str_loc_##item;

#undef TP_STRUCT__entry
#define TP_STRUCT__entry(args...) args
Expand Down

0 comments on commit b0aae68

Please sign in to comment.