Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140836
b: refs/heads/master
c: 91729ef
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt committed Mar 2, 2009
1 parent 723191f commit 09c7924
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 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: 981d081ec8b958b7d962ee40d433581a55d40fc5
refs/heads/master: 91729ef96661bfa7dc53923746cd90b62d5495cc
27 changes: 26 additions & 1 deletion trunk/kernel/trace/trace_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/module.h>
#include <linux/ctype.h>

#include "trace.h"
#include "trace_output.h"

#define TRACE_SYSTEM "TRACE_SYSTEM"

Expand Down Expand Up @@ -447,6 +447,28 @@ event_available_types_read(struct file *filp, char __user *ubuf, size_t cnt,
return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
}

#undef FIELD
#define FIELD(type, name) \
#type, #name, offsetof(typeof(field), name), sizeof(field.name)

static int trace_write_header(struct trace_seq *s)
{
struct trace_entry field;

/* struct trace_entry */
return trace_seq_printf(s,
"\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
"\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
"\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
"\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
"\tfield:%s %s;\toffset:%lu;\tsize:%lu;\n"
"\n",
FIELD(unsigned char, type),
FIELD(unsigned char, flags),
FIELD(unsigned char, preempt_count),
FIELD(int, pid),
FIELD(int, tgid));
}
static ssize_t
event_format_read(struct file *filp, char __user *ubuf, size_t cnt,
loff_t *ppos)
Expand All @@ -465,6 +487,9 @@ event_format_read(struct file *filp, char __user *ubuf, size_t cnt,
if (*ppos)
return 0;

/* If this fails, so will the show_format. */
trace_write_header(s);

r = call->show_format(s);
if (!r) {
/*
Expand Down

0 comments on commit 09c7924

Please sign in to comment.