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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc1/] [or1ksim/] [profiler.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 632 ivang
/* profiler.h -- profiling utility
2
   Copyright (C) 2001 Marko Mlinar, markom@opencores.org
3
 
4
This file is part of OpenRISC 1000 Architectural Simulator.
5
 
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
 
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
GNU General Public License for more details.
15
 
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
 
20
/* Command line utility, that displays profiling information, generated
21
   by or1ksim. (use --profile option at command line, when running or1ksim.  */
22
 
23
#ifndef __PROFILER_H
24
#define __PROFILER_H
25
 
26
#define MAX_STACK 1024
27
#define MAX_FUNCS 1024
28
 
29
#define PROF_CUMULATIVE 0x01
30
#define PROF_QUIET      0x02
31
 
32 879 markom
struct stack_struct {
33
  /* Function address */
34
  unsigned int addr;
35
 
36
  /* Cycles of function start; cycles of subfunctions are added later */
37
  unsigned int cycles;
38
 
39
  /* Return address */
40
  unsigned int raddr;
41
 
42
  /* Name of the function */
43
  char name[33];
44
};
45
 
46
struct func_struct {
47
  /* Start address of function */
48
  unsigned int addr;
49
 
50
  /* Name of the function */
51
  char name[33];
52
 
53
  /* Total cycles spent in function */
54
  long cum_cycles;
55
 
56
  /* Calls to this function */
57
  long calls;
58
};
59
 
60
extern struct func_struct prof_func[MAX_FUNCS];
61
 
62
/* Total number of functions */
63
extern int prof_nfuncs;
64
extern int prof_cycles;
65
 
66
/* Print out command line help */
67
void prof_help ();
68
 
69
/* Acquire data from profiler file */
70
int prof_acquire (char *fprofname);
71
 
72
/* Print out profiling data */
73
void prof_print ();
74
 
75
/* Set options */
76
void prof_set (int _quiet, int _cumulative);
77
 
78 847 markom
int main_profiler (int argc, char *argv[]);
79 632 ivang
#endif /* not __PROFILER_H */

powered by: WebSVN 2.1.0

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