Marc van Dongen <[EMAIL PROTECTED]> writes:

> I was wondering if somebody could help me with the following.
> 
> I have *many* functions-names of the following form
> 
>  descriptor_prefix_TYPE_SUFFIX
> 
> Many different functions have the same descriptor_prefix
> part. The TYPE_SUFFIX is meant to describe the type
> of the arguments of the different functions.
> 
> When I profile my sources (-auto-all) it happens
> a lot that I see names of the following form
> 
>  SourceFile:ModuleName/descripto

Try the following patch; it removes the restrictions on the length of
the cost-centre labels in the profiling report.  The result is that
the graph gets squashed over to the left, but that's not so bad.

Similar patches to CostCenter.lc which deals with the Time &
Allocation profiles are also attached below.  Again, if you have long
names the output will get skewed.

*** HeapProfile.lc      1997/05/18 03:55:38     1.4
--- HeapProfile.lc      1997/10/15 15:01:01
***************
*** 632,638 ****
        case HEAP_BY_CC:
        for (ind = 0; ind < max; ind++) {
            if ((cc = index_cc_table[ind]) != 0 && ! cc_to_ignore(cc)) {
!               fprintf(heap_file, "  %0.11s:%0.16s %ld\n", cc->module, cc->label, 
resid[ind] * sizeof(W_));
            }
            resid[ind] = 0;
        }
--- 632,638 ----
        case HEAP_BY_CC:
        for (ind = 0; ind < max; ind++) {
            if ((cc = index_cc_table[ind]) != 0 && ! cc_to_ignore(cc)) {
!               fprintf(heap_file, "  %s:%s %ld\n", cc->module, cc->label, resid[ind] 
* sizeof(W_));
            }
            resid[ind] = 0;
        }
***************
*** 641,647 ****
        case HEAP_BY_MOD:
        for (ind = 0; ind < max; ind++) {
            if ((cc = index_mod_table[ind]) != 0 && ! cc_to_ignore(cc)) {
!               fprintf(heap_file, "  %0.11s %ld\n", cc->module, resid[ind] * 
sizeof(W_));
            }
            resid[ind] = 0;
        }
--- 641,647 ----
        case HEAP_BY_MOD:
        for (ind = 0; ind < max; ind++) {
            if ((cc = index_mod_table[ind]) != 0 && ! cc_to_ignore(cc)) {
!               fprintf(heap_file, "  %s %ld\n", cc->module, resid[ind] * sizeof(W_));
            }
            resid[ind] = 0;
        }

*** CostCentre.lc       1996/06/27 16:15:34     1.3
--- CostCentre.lc       1997/10/15 15:06:12
***************
*** 269,275 ****
  
            for (cc = Registered_CC; cc != REGISTERED_END; cc = cc->registered) {
                if (cc->time_ticks != 0 && ! cc_to_ignore(cc))
!                   fprintf(serial_file, "  %0.11s:%0.16s %3ld\n",
                        cc->module, cc->label, cc->time_ticks*100 / final_ticks);
            }
  #endif
--- 269,275 ----
  
            for (cc = Registered_CC; cc != REGISTERED_END; cc = cc->registered) {
                if (cc->time_ticks != 0 && ! cc_to_ignore(cc))
!                   fprintf(serial_file, "  %s:%s %3ld\n",
                        cc->module, cc->label, cc->time_ticks*100 / final_ticks);
            }
  #endif
***************
*** 288,297 ****
                if (cc->time_ticks != 0 && !cc_to_ignore(cc)) {
  #ifdef PAR                                          
                  /* Print _percentages_ in the parallel world */
!                   fprintf(serial_file, "  %0.11s:%0.16s %3ld\n",
                      cc->module, cc->label, cc->time_ticks * 100/TICK_FREQUENCY);
  #else
!                   fprintf(serial_file, "  %0.11s:%0.16s %3ld\n",
                      cc->module, cc->label, cc->time_ticks);
  #endif
                }
--- 288,297 ----
                if (cc->time_ticks != 0 && !cc_to_ignore(cc)) {
  #ifdef PAR                                          
                  /* Print _percentages_ in the parallel world */
!                   fprintf(serial_file, "  %s:%s %3ld\n",
                      cc->module, cc->label, cc->time_ticks * 100/TICK_FREQUENCY);
  #else
!                   fprintf(serial_file, "  %s:%s %3ld\n",
                      cc->module, cc->label, cc->time_ticks);
  #endif
                }
***************
*** 396,402 ****
                              || cc->thunk_count || cc->function_count || cc->pap_count
  #endif
           ))))) {
!           fprintf(prof_file, "%-16.16s %-11.11s", cc->label, cc->module);
            if (do_groups) fprintf(prof_file, " %-11.11s",cc->group);
  
            fprintf(prof_file, "%8ld  %5.1f  %5.1f %8ld %5ld %5ld",
--- 396,402 ----
                              || cc->thunk_count || cc->function_count || cc->pap_count
  #endif
           ))))) {
!           fprintf(prof_file, "%-16s %-11s", cc->label, cc->module);
            if (do_groups) fprintf(prof_file, " %-11.11s",cc->group);
  
            fprintf(prof_file, "%8ld  %5.1f  %5.1f %8ld %5ld %5ld",

-- 
Simon Marlow                                             [EMAIL PROTECTED]
University of Glasgow                       http://www.dcs.gla.ac.uk/~simonm/
finger for PGP public key

Reply via email to