Files
sysprof/stackstash.h
Soren Sandmann 0b718ee95c Use stack_node_new() o (profile_load): Use set_root() instead of
2006-11-19  Soren Sandmann <sandmann@redhat.com>

        * profile.c (profile_load): Use stack_node_new() o
        (profile_load): Use set_root() instead of new_from_root();

        * stackstash.c (stack_stash_new_from_root): Delete this function
        (stack_stash_set_root): Add this function
        (stack_node_new): Export this function
2006-11-20 04:08:01 +00:00

75 lines
2.4 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.
*/
#ifndef STACK_STASH_H
#define STACK_STASH_H
#include <glib.h>
typedef struct StackStash StackStash;
typedef struct StackNode StackNode;
struct StackNode
{
gpointer address;
int total;
int size;
StackNode * parent;
StackNode * siblings;
StackNode * children;
StackNode * next;
gboolean toplevel;
};
typedef void (* StackFunction) (GList *trace,
gint size,
gpointer data);
typedef void (* StackNodeFunc) (StackNode *node,
gpointer data);
/* Stach */
StackStash *stack_stash_new (GDestroyNotify destroy);
StackNode * stack_node_new (void);
void stack_stash_add_trace (StackStash *stash,
gulong *addrs,
gint n_addrs,
int size);
void stack_stash_foreach (StackStash *stash,
StackFunction stack_func,
gpointer data);
void stack_node_foreach_trace (StackNode *node,
StackFunction stack_func,
gpointer data);
StackNode *stack_stash_find_node (StackStash *stash,
gpointer address);
void stack_stash_foreach_by_address (StackStash *stash,
StackNodeFunc func,
gpointer data);
StackNode *stack_stash_get_root (StackStash *stash);
StackStash *stack_stash_ref (StackStash *stash);
void stack_stash_unref (StackStash *stash);
void stack_stash_set_root (StackStash *stash,
StackNode *root);
#endif