Files
sysprof/collector.h
Soren Sandmann 476e6f0c1b Call callback with an extra boolean indicating whether the sample read was
2007-10-20  Soren Sandmann <sandmann@daimi.au.dk>

       * collector.c (on_read): Call callback with an extra boolean
       indicating whether the sample read was the first one

       * collector.c (add_trace_to_stash): Allocate addresses on the
       stack if possible.

       * sysprof.c (on_new_sample): Only call update_sensitivity() on the
       first sample.

       * stackstash.c (stack_stash_add_trace): Move match to front


svn path=/trunk/; revision=373
2007-10-20 23:51:35 +00:00

45 lines
1.6 KiB
C

/* Sysprof -- Sampling, systemwide CPU profiler
* Copyright 2004, Red Hat, Inc.
* Copyright 2004, 2005, Soeren Sandmann
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "profile.h"
typedef struct Collector Collector;
typedef void (* CollectorFunc) (gboolean first_sample,
gpointer data);
#define COLLECTOR_ERROR collector_error_quark ()
GQuark collector_error_quark (void);
typedef enum
{
COLLECTOR_ERROR_CANT_OPEN_FILE
} CollectorError;
/* callback is called whenever a new sample arrives */
Collector *collector_new (CollectorFunc callback,
gpointer data);
gboolean collector_start (Collector *collector,
GError **err);
void collector_stop (Collector *collector);
void collector_reset (Collector *collector);
int collector_get_n_samples (Collector *collector);
Profile * collector_create_profile (Collector *collector);