From: Dave J. <da...@su...> - 2002-07-17 11:45:53
|
hey folks, I just cvs updated on a shell that I haven't used for a while, and noticed I had some old patches that I never committed for some reason. problem is, it's been so long, and I've been out of the loop for a while, so a, I'm not sure why I needed these, and b, I'm not sure if what they fix is fixed in a different way now.. comments? Dave Index: module/oprofile.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/module/oprofile.c,v retrieving revision 1.28 diff -u -p -r1.28 oprofile.c --- module/oprofile.c 5 Jan 2002 03:17:48 -0000 1.28 +++ module/oprofile.c 17 Jul 2002 11:40:21 -0000 @@ -519,6 +519,9 @@ static int oprof_read(struct file *file, pmc_select_start(cpu_num); + /* 0 is a special case for us, prefer -EINTR instead. Ugly. */ + if (!count) + return -EINTR; return count; } Index: pp/op_time.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/pp/op_time.cpp,v retrieving revision 1.6 diff -u -p -r1.6 op_time.cpp --- pp/op_time.cpp 29 Dec 2001 23:51:25 -0000 1.6 +++ pp/op_time.cpp 17 Jul 2002 11:40:21 -0000 @@ -193,10 +193,15 @@ static void sort_file_list(map_t & resul static void out_filename(const string& app_name, size_t app_count, u32 count, double total_count) { - cout << demangle_filename(app_name) << " " << count << " " - << (count / total_count) * 100 << "%"; + cout << demangle_filename(app_name) << " " << count << " "; - if (app_count != size_t(-1)) + if (total_count > 1) { + cout << (count / total_count) * 100 << "%"; + } else { + cout << "0%"; + } + + if (app_count != size_t(-1) && (app_count!=0)) cout << " (" << (count / double(app_count)) * 100 << "%)"; cout << endl; -- | Dave Jones. http://www.codemonkey.org.uk | SuSE Labs |
From: Philippe E. <ph...@wa...> - 2002-07-17 13:08:41
|
Dave Jones wrote: >hey folks, > I just cvs updated on a shell that I haven't used for a while, > and noticed I had some old patches that I never committed for some > reason. > problem is, it's been so long, and I've been out of the loop for a > while, so a, I'm not sure why I needed these, and b, I'm not sure > if what they fix is fixed in a different way now.. > >comments? > John applied the first, you applied the second :) Phil |
From: Dave J. <da...@su...> - 2002-07-17 13:46:51
|
On Wed, Jul 17, 2002 at 03:10:15PM +0200, Philippe Elie wrote: > John applied the first, you applied the second :) Odd, they both still show up as unapplied when I do cvs update ; cvs diff Are we looking at different branches perhaps ? I'm looking at HEAD of CVS. Dave. -- | Dave Jones. http://www.codemonkey.org.uk | SuSE Labs |
From: Philippe E. <ph...@wa...> - 2002-07-17 14:47:15
|
Dave Jones wrote: >On Wed, Jul 17, 2002 at 03:10:15PM +0200, Philippe Elie wrote: > > > John applied the first, you applied the second :) > >Odd, they both still show up as unapplied when I do >cvs update ; cvs diff > >Are we looking at different branches perhaps ? >I'm looking at HEAD of CVS. > I dunno what occur, I checked through the oprofile cvsweb interface and you commited this patch in version 1.8, look at line 199 at http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/oprofile/oprofile/pp/op_time.cpp?annotate=1.8 Phil |
From: Dave J. <da...@su...> - 2002-07-17 14:57:16
|
On Wed, Jul 17, 2002 at 04:48:50PM +0200, Philippe Elie wrote: > >Are we looking at different branches perhaps ? > >I'm looking at HEAD of CVS. > I dunno what occur, I checked through the oprofile cvsweb > interface and you commited this patch in version 1.8, look at line 199 at > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/oprofile/oprofile/pp/op_time.cpp?annotate=1.8 Totally weird. I checked out a clean repository, and also cvs updated the old one (so both should be the same). The updated one however contained old files. I'll work from the fresh one 8-) (Wish I'd realised this before spending an hour or so hacking an ancient codebase.. *sigh*) Dave -- | Dave Jones. http://www.codemonkey.org.uk | SuSE Labs |
From: John L. <le...@mo...> - 2002-07-17 15:50:46
|
On Wed, Jul 17, 2002 at 01:45:31PM +0200, Dave Jones wrote: > problem is, it's been so long, and I've been out of the loop for a > while, so a, I'm not sure why I needed these, and b, I'm not sure > if what they fix is fixed in a different way now.. :) > --- module/oprofile.c 5 Jan 2002 03:17:48 -0000 1.28 > +++ module/oprofile.c 17 Jul 2002 11:40:21 -0000 > @@ -519,6 +519,9 @@ static int oprof_read(struct file *file, > > pmc_select_start(cpu_num); > > + /* 0 is a special case for us, prefer -EINTR instead. Ugly. */ > + if (!count) > + return -EINTR; > return count; The bogosity that required this is gone now, thankfully. > diff -u -p -r1.6 op_time.cpp > --- pp/op_time.cpp 29 Dec 2001 23:51:25 -0000 1.6 > +++ pp/op_time.cpp 17 Jul 2002 11:40:21 -0000 > @@ -193,10 +193,15 @@ static void sort_file_list(map_t & resul > static void out_filename(const string& app_name, size_t app_count, > u32 count, double total_count) > { > - cout << demangle_filename(app_name) << " " << count << " " > - << (count / total_count) * 100 << "%"; > + cout << demangle_filename(app_name) << " " << count << " "; > > - if (app_count != size_t(-1)) > + if (total_count > 1) { > + cout << (count / total_count) * 100 << "%"; > + } else { > + cout << "0%"; > + } > + > + if (app_count != size_t(-1) && (app_count!=0)) > cout << " (" << (count / double(app_count)) * 100 << "%)"; Philippe ? My memory is very fuzzy here ... regards john -- "i am sorey I cant reads yuor emale because my emale box has filtar on it whitch says, "NO EMALES FROM PEOAPAL UNDER IQ OF 1" - jeffk |