#include <stdio.h>
#include <string.h>
#include <malloc.h>
Go to the source code of this file.
◆ NUM_FILES
◆ add_fn()
void add_fn |
( |
int |
fn, |
|
|
char * |
b |
|
) |
| |
Definition at line 23 of file sprof.c.
27 memset(
line_buf[fn],0,1000*
sizeof(
int));
VAR char * file_names[NUM_FILES]
void * malloc(size_t size)
VAR int * line_buf[NUM_FILES]
◆ add_line()
void add_line |
( |
int |
fn, |
|
|
int |
l |
|
) |
| |
Definition at line 13 of file sprof.c.
21 else printf(
"overflow: %d\n",
l);
VAR int * line_buf[NUM_FILES]
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 73 of file sprof.c.
76 f=fopen(
"smon.out",
"r");
77 if(
f==
NULL) { printf(
"cannot read smon.out\n");
return 2; }
81 if ((strncmp(
buf,
"STDIN",5)!=0)
82 && (strncmp(
buf,
"(none)",6)!=0)
83 && (strncmp(
buf,
"::",2)!=0))
89 while((
buf[i]!=
':')&&(i<200)) i++;
92 while ((
buf[i]!=
' ')&&(i<200)) i++;
93 sscanf(
buf+i,
"%d",&line_no);
100 printf(
"new file:%s\n",
buf);
108 printf(
"----- all read\n");
113 printf(
"File %s =============================\n",
file_names[i]);
void add_fn(int fn, char *b)
VAR char * file_names[NUM_FILES]
void add_line(int fn, int l)
◆ print_line()
Definition at line 30 of file sprof.c.
52 s=fgets(line,500,fi);ln++;
55 fprintf(fo,
"%4d + %s",ln,line);
57 fprintf(fo,
"%4d %s",ln,line);
67 if ((1<<j) &
line_buf[
l][i]) printf(
"%d,",i*32+j);
const CanonicalForm int s
VAR char * file_names[NUM_FILES]
VAR int * line_buf[NUM_FILES]
◆ buf
◆ file_names
◆ fn_cnt
◆ line_buf