|
From: <sv...@va...> - 2005-09-25 16:36:02
|
Author: njn
Date: 2005-09-25 17:35:56 +0100 (Sun, 25 Sep 2005)
New Revision: 4763
Log:
For Cachegrind and Massif, print the exename as well as the args.
I also backported the testing for NULL of these to avoid them being
lost when this gets merged back into the trunk.
Modified:
branches/ASPACEM/cachegrind/cg_main.c
branches/ASPACEM/massif/ms_main.c
Modified: branches/ASPACEM/cachegrind/cg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/cachegrind/cg_main.c 2005-09-25 15:45:10 UTC (rev 47=
62)
+++ branches/ASPACEM/cachegrind/cg_main.c 2005-09-25 16:35:56 UTC (rev 47=
63)
@@ -897,12 +897,17 @@
// "cmd:" line
VG_(strcpy)(buf, "cmd:");
VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
+ if (VG_(args_the_exename)) {
+ VG_(write)(fd, " ", 1);
+ VG_(write)(fd, VG_(args_the_exename),=20
+ VG_(strlen)( VG_(args_the_exename) ));
+ }
for (i =3D 0; i < VG_(args_for_client).used; i++) {
- if (VG_(args_for_client).strs[i] =3D=3D NULL)
- continue;
- VG_(write)(fd, " ", 1);
- VG_(write)(fd, VG_(args_for_client).strs[i],=20
- VG_(strlen)(VG_(args_for_client).strs[i]));
+ if (VG_(args_for_client).strs[i]) {
+ VG_(write)(fd, " ", 1);
+ VG_(write)(fd, VG_(args_for_client).strs[i],=20
+ VG_(strlen)(VG_(args_for_client).strs[i]));
+ }
}
// "events:" line
VG_(sprintf)(buf, "\nevents: Ir I1mr I2mr Dr D1mr D2mr Dw D1mw D2mw\n=
");
Modified: branches/ASPACEM/massif/ms_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/massif/ms_main.c 2005-09-25 15:45:10 UTC (rev 4762)
+++ branches/ASPACEM/massif/ms_main.c 2005-09-25 16:35:56 UTC (rev 4763)
@@ -1375,8 +1375,13 @@
=20
// File header, including command line
SPRINTF(buf, "JOB \"");
- for (i =3D 0; i < VG_(args_for_client).used; i++)
- SPRINTF(buf, "%s ", VG_(args_for_client).strs[i]);
+ if (VG_(args_the_exename)) {
+ SPRINTF(buf, "%s", VG_(args_the_exename));
+ }
+ for (i =3D 0; i < VG_(args_for_client).used; i++) {
+ if (VG_(args_for_client).strs[i])
+ SPRINTF(buf, " %s", VG_(args_for_client).strs[i]);
+ }
SPRINTF(buf, /*" (%d ms/sample)\"\n"*/ "\"\n"
"DATE \"\"\n"
"SAMPLE_UNIT \"ms\"\n"
@@ -1697,9 +1702,14 @@
}
=20
// Command line
- SPRINTF(buf, "Command: ");
- for (i =3D 0; i < VG_(args_for_client).used; i++)
- SPRINTF(buf, "%s ", VG_(args_for_client).strs[i]);
+ SPRINTF(buf, "Command:");
+ if (VG_(args_the_exename)) {
+ SPRINTF(buf, " %s", VG_(args_the_exename));
+ }
+ for (i =3D 0; i < VG_(args_for_client).used; i++) {
+ if (VG_(args_for_client).strs[i])
+ SPRINTF(buf, " %s", VG_(args_for_client).strs[i]);
+ }
SPRINTF(buf, "\n%s\n", maybe_p);
=20
if (clo_heap)
|