mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 23:51:06 +00:00
Initial revision
This commit is contained in:
74
profile.h
Normal file
74
profile.h
Normal file
@ -0,0 +1,74 @@
|
||||
/* 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);
|
||||
Reference in New Issue
Block a user