Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158446
b: refs/heads/master
c: e647d6b
h: refs/heads/master
v: v3
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Aug 19, 2009
1 parent 32666e5 commit 4936b17
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 14be96c9716cb8c46dca94bd890defd7856e0734
refs/heads/master: e647d6b314266adb904d4b84973eda0afa856946
8 changes: 1 addition & 7 deletions trunk/include/linux/ftrace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ extern int filter_current_check_discard(struct ftrace_event_call *call,

extern int trace_define_field(struct ftrace_event_call *call, char *type,
char *name, int offset, int size, int is_signed);
extern int trace_define_common_fields(struct ftrace_event_call *call);

#define is_signed_type(type) (((type)(-1)) < 0)

Expand All @@ -166,11 +167,4 @@ do { \
__trace_printk(ip, fmt, ##args); \
} while (0)

#define __common_field(type, item, is_signed) \
ret = trace_define_field(event_call, #type, "common_" #item, \
offsetof(typeof(field.ent), item), \
sizeof(field.ent.item), is_signed); \
if (ret) \
return ret;

#endif /* _LINUX_FTRACE_EVENT_H */
8 changes: 3 additions & 5 deletions trunk/include/trace/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,9 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
struct ftrace_raw_##call field; \
int ret; \
\
__common_field(int, type, 1); \
__common_field(unsigned char, flags, 0); \
__common_field(unsigned char, preempt_count, 0); \
__common_field(int, pid, 1); \
__common_field(int, tgid, 1); \
ret = trace_define_common_fields(event_call); \
if (ret) \
return ret; \
\
tstruct; \
\
Expand Down
22 changes: 22 additions & 0 deletions trunk/kernel/trace/trace_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,28 @@ int trace_define_field(struct ftrace_event_call *call, char *type,
}
EXPORT_SYMBOL_GPL(trace_define_field);

#define __common_field(type, item) \
ret = trace_define_field(call, #type, "common_" #item, \
offsetof(typeof(ent), item), \
sizeof(ent.item), \
is_signed_type(type)); \
if (ret) \
return ret;

int trace_define_common_fields(struct ftrace_event_call *call)
{
int ret;
struct trace_entry ent;

__common_field(unsigned short, type);
__common_field(unsigned char, flags);
__common_field(unsigned char, preempt_count);
__common_field(int, pid);
__common_field(int, tgid);

return ret;
}

#ifdef CONFIG_MODULES

static void trace_destroy_fields(struct ftrace_event_call *call)
Expand Down
8 changes: 3 additions & 5 deletions trunk/kernel/trace/trace_export.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,9 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
struct args field; \
int ret; \
\
__common_field(unsigned char, type, 0); \
__common_field(unsigned char, flags, 0); \
__common_field(unsigned char, preempt_count, 0); \
__common_field(int, pid, 1); \
__common_field(int, tgid, 1); \
ret = trace_define_common_fields(event_call); \
if (ret) \
return ret; \
\
tstruct; \
\
Expand Down

0 comments on commit 4936b17

Please sign in to comment.