printgprof.c (1591) | printgprof.c (2513) |
---|---|
1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 96 unchanged lines hidden (view full) --- 105 * this doesn't hurt sinc eall the numerators will be zero. 106 */ 107 totime = 1.0; 108 } 109 printf( "%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n" , 110 "% " , "cumulative" , "self " , "" , "self " , "total " , "" ); 111 printf( "%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n" , 112 "time" , "seconds " , "seconds" , "calls" , | 1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 96 unchanged lines hidden (view full) --- 105 * this doesn't hurt sinc eall the numerators will be zero. 106 */ 107 totime = 1.0; 108 } 109 printf( "%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n" , 110 "% " , "cumulative" , "self " , "" , "self " , "total " , "" ); 111 printf( "%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n" , 112 "time" , "seconds " , "seconds" , "calls" , |
113 "ms/call" , "ms/call" , "name" ); | 113 hz >= 10000 ? "us/call" : "ms/call" , 114 hz >= 10000 ? "us/call" : "ms/call" , "name" ); |
114} 115 116flatprofline( np ) 117 register nltype *np; 118{ 119 120 if ( zflag == 0 && np -> ncall == 0 && np -> time == 0 ) { 121 return; 122 } 123 actime += np -> time; | 115} 116 117flatprofline( np ) 118 register nltype *np; 119{ 120 121 if ( zflag == 0 && np -> ncall == 0 && np -> time == 0 ) { 122 return; 123 } 124 actime += np -> time; |
124 printf( "%5.1f %10.2f %8.2f" , 125 100 * np -> time / totime , actime / hz , np -> time / hz ); | 125 if (hz >= 10000) 126 printf( "%5.1f %10.3f %8.3f" , 127 100 * np -> time / totime , actime / hz , np -> time / hz ); 128 else 129 printf( "%5.1f %10.2f %8.2f" , 130 100 * np -> time / totime , actime / hz , np -> time / hz ); |
126 if ( np -> ncall != 0 ) { | 131 if ( np -> ncall != 0 ) { |
127 printf( " %8d %8.2f %8.2f " , np -> ncall , 128 1000 * np -> time / hz / np -> ncall , 129 1000 * ( np -> time + np -> childtime ) / hz / np -> ncall ); | 132 if (hz >= 10000) 133 printf( " %8d %8.0f %8.0f " , np -> ncall , 134 1e6 * np -> time / hz / np -> ncall , 135 1e6 * ( np -> time + np -> childtime ) / hz / np -> ncall ); 136 else 137 printf( " %8d %8.2f %8.2f " , np -> ncall , 138 1000 * np -> time / hz / np -> ncall , 139 1000 * ( np -> time + np -> childtime ) / hz / np -> ncall ); |
130 } else { 131 printf( " %8.8s %8.8s %8.8s " , "" , "" , "" ); 132 } 133 printname( np ); 134 printf( "\n" ); 135} 136 137gprofheader() --- 581 unchanged lines hidden --- | 140 } else { 141 printf( " %8.8s %8.8s %8.8s " , "" , "" , "" ); 142 } 143 printname( np ); 144 printf( "\n" ); 145} 146 147gprofheader() --- 581 unchanged lines hidden --- |