Files
sysprof/profile.h
Søren Sandmann Pedersen 43dddf31ac Initial revision
2004-04-27 11:08:55 +00:00

75 lines
2.2 KiB
C

/* MemProf -- memory profiler and leak detector
* Copyright 2002, Soeren Sandmann (sandmann@daimi.au.dk)
*
* 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 <glib.h>
#include "binfile.h"
#include "process.h"
#include "stackstash.h"
typedef struct Profile Profile;
typedef struct ProfileObject ProfileObject;
typedef struct ProfileDescendant ProfileDescendant;
typedef struct ProfileCaller ProfileCaller;
struct ProfileObject
{
char * name; /* identifies this object uniquely */
guint total; /* sum of all toplevel totals */
guint self; /* sum of all selfs */
};
struct ProfileDescendant
{
ProfileObject * object;
guint self;
guint total;
guint non_recursion;
ProfileDescendant * parent;
ProfileDescendant * siblings;
ProfileDescendant * children;
int marked_non_recursive;
int marked_total;
};
struct Profile
{
gint profile_size;
GList * objects;
};
struct ProfileCaller
{
ProfileObject * object; /* can be NULL */
guint total;
guint self;
ProfileCaller * next;
};
Profile * profile_new (StackStash *stash);
void profile_free (Profile *profile);
ProfileDescendant *profile_create_descendants (Profile *prf,
ProfileObject *object);
ProfileCaller * profile_list_callers (Profile *profile,
ProfileObject *callee);
void profile_caller_free (ProfileCaller *caller);
void profile_descendant_free (ProfileDescendant *descendant);