OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel-0-3-0-rc2/] [or1ksim/] [profiler.h] - Diff between revs 879 and 1748

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 879 Rev 1748
Line 1... Line 1...
/* profiler.h -- profiling utility
/* profiler.h -- profiling utility
   Copyright (C) 2001 Marko Mlinar, markom@opencores.org
 
 
 
This file is part of OpenRISC 1000 Architectural Simulator.
 
 
 
This program is free software; you can redistribute it and/or modify
   Copyright (C) 2001 Marko Mlinar, markom@opencores.org
it under the terms of the GNU General Public License as published by
   Copyright (C) 2008 Embecosm Limited
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,
   Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
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
   This file is part of Or1ksim, the OpenRISC 1000 Architectural Simulator.
along with this program; if not, write to the Free Software
 
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
 
 
 
/* Command line utility, that displays profiling information, generated
   This program is free software; you can redistribute it and/or modify it
   by or1ksim. (use --profile option at command line, when running or1ksim.  */
   under the terms of the GNU General Public License as published by the Free
 
   Software Foundation; either version 3 of the License, or (at your option)
 
   any later version.
 
 
#ifndef __PROFILER_H
   This program is distributed in the hope that it will be useful, but WITHOUT
#define __PROFILER_H
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
   more details.
 
 
#define MAX_STACK 1024
   You should have received a copy of the GNU General Public License along
#define MAX_FUNCS 1024
   with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
#define PROF_CUMULATIVE 0x01
/* This program is commented throughout in a fashion suitable for processing
#define PROF_QUIET      0x02
   with Doxygen. */
 
 
struct stack_struct {
 
  /* Function address */
 
  unsigned int addr;
 
 
 
  /* Cycles of function start; cycles of subfunctions are added later */
#ifndef PROFILER__H
  unsigned int cycles;
#define PROFILER__H
 
 
  /* Return address */
/*! Maximum number of functions that can be profiled */
  unsigned int raddr;
#define MAX_FUNCS 1024
 
 
  /* Name of the function */
 
  char name[33];
 
};
 
 
 
 
/*! Data structure for information about functions */
struct func_struct {
struct func_struct {
  /* Start address of function */
  unsigned int  addr;           /*!< Start address of function */
  unsigned int addr;
  char          name[33];       /*!< Name of the function */
 
  long          cum_cycles;     /*!< Total cycles spent in function */
  /* Name of the function */
  long          calls;          /*!< Calls to this function */
  char name[33];
 
 
 
  /* Total cycles spent in function */
 
  long cum_cycles;
 
 
 
  /* Calls to this function */
 
  long calls;
 
};
};
 
 
 
/* Global data structures for external use */
extern struct func_struct prof_func[MAX_FUNCS];
extern struct func_struct prof_func[MAX_FUNCS];
 
 
/* Total number of functions */
 
extern int prof_nfuncs;
extern int prof_nfuncs;
extern int prof_cycles;
extern int prof_cycles;
 
 
/* Print out command line help */
/* Function prototypes for external use */
void prof_help ();
int   prof_acquire (const char *fprofname);
 
void  prof_set (int  _quiet,
/* Acquire data from profiler file */
                int  _cumulative);
int prof_acquire (char *fprofname);
int   main_profiler (int   argc,
 
                     char *argv[],
/* Print out profiling data */
                     int   just_help);
void prof_print ();
 
 
 
/* Set options */
 
void prof_set (int _quiet, int _cumulative);
 
 
 
int main_profiler (int argc, char *argv[]);
#endif  /* PROFILER__H */
#endif /* not __PROFILER_H */
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.