[sysprof/ftrace: 6/16] Update to make it work with ftrace in 2.6.29
- From: Søren Sandmann Pedersen <ssp src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [sysprof/ftrace: 6/16] Update to make it work with ftrace in 2.6.29
- Date: Fri, 14 Aug 2009 06:57:09 +0000 (UTC)
commit bb454b1bdfe71bec9e0341a5cec8fe055255c243
Author: Frederic Weisbecker <fweisbec gmail com>
Date: Sat Feb 21 01:39:32 2009 -0500
Update to make it work with ftrace in 2.6.29
collector.c | 23 +++++++++--------------
1 files changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/collector.c b/collector.c
index ea9662b..af9bec2 100644
--- a/collector.c
+++ b/collector.c
@@ -333,7 +333,7 @@ collector_set_tracing (Collector *collector,
*/
#define ENTRY_SIZE ( \
sizeof (guint32) + /* pid */ \
- sizeof (guint8) + /* cpu */ \
+ sizeof (guint32) + /* cpu */ \
sizeof (guint64) + /* timestamp */ \
sizeof (gulong) + /* type */ \
sizeof (gulong) + /* address */ \
@@ -343,12 +343,12 @@ collector_set_tracing (Collector *collector,
typedef struct Entry
{
- gint pid;
- gint cpu;
+ guint32 pid;
+ guint32 cpu;
guint64 timestamp;
glong type;
- glong address;
- glong location;
+ gulong address;
+ gulong location;
} Entry;
static int
@@ -371,12 +371,7 @@ read8 (const guchar *line)
static void
read_entry (const guchar *input, Entry *entry)
{
- entry->pid = read4 (input + 0);
- entry->cpu = *(input + 4);
- entry->timestamp = read8 (input + 5);
- entry->type = read4 (input + 13);
- entry->address = read4 (input + 17);
- entry->location = read4 (input + 21);
+ memcpy (entry, input, sizeof (Entry));
if (entry->type < -1 || entry->type > 3 || entry->pid < 0)
{
@@ -540,7 +535,7 @@ start_tracing (Collector *collector,
}
}
- if (!write_text ("/sys/kernel/debug/tracing/iter_ctrl", "noblock"))
+ if (!write_text ("/sys/kernel/debug/tracing/trace_options", "noblock"))
{
return FALSE;
}
@@ -556,13 +551,13 @@ start_tracing (Collector *collector,
}
- if (!write_text ("/sys/kernel/debug/tracing/iter_ctrl", "raw\n"))
+ if (!write_text ("/sys/kernel/debug/tracing/trace_options", "raw\n"))
{
g_print ("Failed to make raw\n");
return FALSE;
}
- if (!write_text ("/sys/kernel/debug/tracing/iter_ctrl", "bin\n"))
+ if (!write_text ("/sys/kernel/debug/tracing/trace_options", "bin\n"))
{
g_print ("Failed to make binary\n");
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]