[sysprof] Disable use of hardware perf counters.
- From: Søren Sandmann Pedersen <ssp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] Disable use of hardware perf counters.
- Date: Tue, 9 Mar 2010 18:09:01 +0000 (UTC)
commit 08d4d26060d8e5d089b9c9733204a220233c75c8
Author: Søren Sandmann <sandmann daimi au dk>
Date: Tue Mar 9 12:06:36 2010 -0500
Disable use of hardware perf counters.
They don't seem to actually work on a lot of hardware.
collector.c | 6 +++++-
collector.h | 3 ++-
sysprof-cli.c | 5 ++---
sysprof.c | 2 +-
4 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/collector.c b/collector.c
index d034405..438b920 100644
--- a/collector.c
+++ b/collector.c
@@ -133,6 +133,8 @@ struct Collector
int n_samples;
GList * counters;
+
+ gboolean use_hw_counters;
};
static int
@@ -531,7 +533,8 @@ collector_reset (Collector *collector)
/* callback is called whenever a new sample arrives */
Collector *
-collector_new (CollectorFunc callback,
+collector_new (gboolean use_hw_counters,
+ CollectorFunc callback,
gpointer data)
{
Collector *collector = g_new0 (Collector, 1);
@@ -539,6 +542,7 @@ collector_new (CollectorFunc callback,
collector->callback = callback;
collector->data = data;
collector->tracker = NULL;
+ collector->use_hw_counters = use_hw_counters;
collector_reset (collector);
diff --git a/collector.h b/collector.h
index 2eb518c..3c0c118 100644
--- a/collector.h
+++ b/collector.h
@@ -34,7 +34,8 @@ typedef enum
} CollectorError;
/* callback is called whenever a new sample arrives */
-Collector *collector_new (CollectorFunc callback,
+Collector *collector_new (gboolean use_hw_counters,
+ CollectorFunc callback,
gpointer data);
gboolean collector_start (Collector *collector,
GError **err);
diff --git a/sysprof-cli.c b/sysprof-cli.c
index 7d0409c..2500dda 100644
--- a/sysprof-cli.c
+++ b/sysprof-cli.c
@@ -110,13 +110,12 @@ die (const char *err_msg)
}
int
-main (int argc,
- char *argv[])
+main (int argc, char *argv[])
{
Application *app = g_new0 (Application, 1);
GError *err;
- app->collector = collector_new (NULL, NULL);
+ app->collector = collector_new (FALSE, NULL, NULL);
app->outfile = g_strdup (argv[1]);
app->main_loop = g_main_loop_new (NULL, 0);
diff --git a/sysprof.c b/sysprof.c
index 788cfd9..be87247 100644
--- a/sysprof.c
+++ b/sysprof.c
@@ -1587,7 +1587,7 @@ application_new (void)
{
Application *app = g_new0 (Application, 1);
- app->collector = collector_new (on_new_sample, app);
+ app->collector = collector_new (FALSE, on_new_sample, app);
app->state = INITIAL;
return app;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]