mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-09 22:50:54 +00:00
Disable use of hardware perf counters.
They don't seem to actually work on a lot of hardware.
This commit is contained in:
@ -133,6 +133,8 @@ struct Collector
|
|||||||
int n_samples;
|
int n_samples;
|
||||||
|
|
||||||
GList * counters;
|
GList * counters;
|
||||||
|
|
||||||
|
gboolean use_hw_counters;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -531,7 +533,8 @@ collector_reset (Collector *collector)
|
|||||||
|
|
||||||
/* callback is called whenever a new sample arrives */
|
/* callback is called whenever a new sample arrives */
|
||||||
Collector *
|
Collector *
|
||||||
collector_new (CollectorFunc callback,
|
collector_new (gboolean use_hw_counters,
|
||||||
|
CollectorFunc callback,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
Collector *collector = g_new0 (Collector, 1);
|
Collector *collector = g_new0 (Collector, 1);
|
||||||
@ -539,6 +542,7 @@ collector_new (CollectorFunc callback,
|
|||||||
collector->callback = callback;
|
collector->callback = callback;
|
||||||
collector->data = data;
|
collector->data = data;
|
||||||
collector->tracker = NULL;
|
collector->tracker = NULL;
|
||||||
|
collector->use_hw_counters = use_hw_counters;
|
||||||
|
|
||||||
collector_reset (collector);
|
collector_reset (collector);
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,8 @@ typedef enum
|
|||||||
} CollectorError;
|
} CollectorError;
|
||||||
|
|
||||||
/* callback is called whenever a new sample arrives */
|
/* callback is called whenever a new sample arrives */
|
||||||
Collector *collector_new (CollectorFunc callback,
|
Collector *collector_new (gboolean use_hw_counters,
|
||||||
|
CollectorFunc callback,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
gboolean collector_start (Collector *collector,
|
gboolean collector_start (Collector *collector,
|
||||||
GError **err);
|
GError **err);
|
||||||
|
|||||||
@ -110,13 +110,12 @@ die (const char *err_msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc,
|
main (int argc, char *argv[])
|
||||||
char *argv[])
|
|
||||||
{
|
{
|
||||||
Application *app = g_new0 (Application, 1);
|
Application *app = g_new0 (Application, 1);
|
||||||
GError *err;
|
GError *err;
|
||||||
|
|
||||||
app->collector = collector_new (NULL, NULL);
|
app->collector = collector_new (FALSE, NULL, NULL);
|
||||||
app->outfile = g_strdup (argv[1]);
|
app->outfile = g_strdup (argv[1]);
|
||||||
app->main_loop = g_main_loop_new (NULL, 0);
|
app->main_loop = g_main_loop_new (NULL, 0);
|
||||||
|
|
||||||
|
|||||||
@ -1587,7 +1587,7 @@ application_new (void)
|
|||||||
{
|
{
|
||||||
Application *app = g_new0 (Application, 1);
|
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;
|
app->state = INITIAL;
|
||||||
|
|
||||||
return app;
|
return app;
|
||||||
|
|||||||
Reference in New Issue
Block a user