X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fmisc%2Fspat-analysers%2Ficount.c;fp=ghc%2Fmisc%2Fspat-analysers%2Ficount.c;h=0000000000000000000000000000000000000000;hb=5eb1c77c795f92ed0f4c8023847e9d4be1a4fd0d;hp=e47bd11d738140cbba3acaffdbf659d195d4120c;hpb=f7ecf7234c224489be8a5e63fced903b655d92ee;p=ghc-hetmet.git diff --git a/ghc/misc/spat-analysers/icount.c b/ghc/misc/spat-analysers/icount.c deleted file mode 100644 index e47bd11..0000000 --- a/ghc/misc/spat-analysers/icount.c +++ /dev/null @@ -1,91 +0,0 @@ -#define VERSION "24-Jan-94" -#define PROGNAME "ICount" - -#define SHADE - -#include - -#include -#include -#include -#include - -#include -#define TR_REGS -#include -#include -#include - -static long long info[NIHASH]; - -#define STATS_FILE "ICNT" - -/* fwd decls */ -void print_results(); - -#define CHECKPOINT 1000000 /* reporting frequency */ -static long countdown = CHECKPOINT; - -char *anal_usage = ""; -char *anal_version = VERSION; - -initialize(argc,argv,envp) - int argc; - char **argv, envp; -{ - unsigned i, j; - - /* Setup the trace */ - shade_trctl_trsize(sizeof(Trace)); - - shade_trctl_it (IT_ANY, 1, 0, TC_IH); - - /* init table */ - for (j = 0; j < NIHASH; j++) - info[j] = 0LL; -} - -int analyze(argc,argv,envp) - int argc; - char **argv, envp; -{ - Trace *tr; - int i; - - for (i = 0; tr = shade_step(); i++) { - - info[tr->tr_ih] += 1LL; - - if (countdown-- < 0) { - print_results("Intermediate:"); - countdown = CHECKPOINT; - } - } - return(0); -} - -void -terminate() -{ - print_results("Final:"); -} - -void -print_results(header) - char *header; -{ - int i, j; - static FILE *statf = NULL; - - if ((statf = fopen("ICNT", "w")) == NULL) { - fprintf(stderr, "Cannot open statistics file ICNT\n"); - exit(1); - } - fprintf(statf, "%s\n\n", header); - - for (i = 0; i < NIHASH; i++) { - fprintf(statf, "%8x: %8ld\n", i, (long) info[i]); - } - - fclose(statf); -}