aboutsummaryrefslogtreecommitdiff
path: root/gprofng/src
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2022-05-27 19:54:26 -0700
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2022-05-27 19:56:25 -0700
commit6094a48ec821a52731172f3471dce4923a482cd1 (patch)
tree0c96e2fd24df377bf59744d9c35600e57516f088 /gprofng/src
parent4fb8f32e4063c4670e63c79f1384ee4f6bba08f0 (diff)
downloadgdb-6094a48ec821a52731172f3471dce4923a482cd1.zip
gdb-6094a48ec821a52731172f3471dce4923a482cd1.tar.gz
gdb-6094a48ec821a52731172f3471dce4923a482cd1.tar.bz2
gprofng: fix build with -mx32
gprofng/ChangeLog 2022-05-27 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/28983 PR gprofng/29143 * src/Experiment.cc (write_header): Fix argument for ctime. Fix -Wformat= warnings. * src/Dbe.cc: Likewise. * src/DwarfLib.h: Fix [-Wsign-compare] warnings. * src/Experiment.h: Likewise. * src/ipc.cc: Fix -Wformat= warnings.
Diffstat (limited to 'gprofng/src')
-rw-r--r--gprofng/src/Dbe.cc14
-rw-r--r--gprofng/src/DwarfLib.h6
-rw-r--r--gprofng/src/Experiment.cc16
-rw-r--r--gprofng/src/Experiment.h2
-rw-r--r--gprofng/src/ipc.cc2
5 files changed, 21 insertions, 19 deletions
diff --git a/gprofng/src/Dbe.cc b/gprofng/src/Dbe.cc
index 1a6e521..d2cd94b 100644
--- a/gprofng/src/Dbe.cc
+++ b/gprofng/src/Dbe.cc
@@ -1944,21 +1944,19 @@ dbeGetOverviewText (int dbevindex)
info->append (dbe_sprintf (GTXT (" Target : '%s'"), field));
field = exp->hostname;
if (field && field[0])
- info->append (dbe_sprintf (NTXT (" %s %s (%s, %s)"),
- GTXT ("Host :"),
+ info->append (dbe_sprintf (GTXT (" Host : %s (%s, %s)"),
field,
exp->architecture ? exp->architecture
: GTXT ("<CPU architecture not recorded>"),
exp->os_version ? exp->os_version
: GTXT ("<OS version not recorded>")));
- long start_sec = exp->start_sec;
- char *p = ctime (&start_sec); // does this need to be freed? YXXX
+ time_t start_sec = (time_t) exp->start_sec;
+ char *p = ctime (&start_sec);
hrtime_t tot_time = dbeCalcGroupDuration (grInd);
double seconds = tot_time * 1.e-9;
- info->append (dbe_sprintf (NTXT (" %s %s %s %0.3f %s"),
- GTXT ("Start Time :"), p,
- GTXT ("Duration :"), seconds,
- GTXT ("Seconds")));
+ info->append (dbe_sprintf (
+ GTXT (" Start Time : %s Duration : %0.3f Seconds"),
+ p, seconds));
// Number of descendants/processes would be nice
info->append (dbe_strdup (NTXT ("")));
}
diff --git a/gprofng/src/DwarfLib.h b/gprofng/src/DwarfLib.h
index 95eff57..07bd60f 100644
--- a/gprofng/src/DwarfLib.h
+++ b/gprofng/src/DwarfLib.h
@@ -152,9 +152,9 @@ private:
uint64_t timestamp;
uint64_t file_size;
uint64_t address;
- uint32_t file;
- uint32_t line;
- uint32_t column;
+ int file;
+ int line;
+ int column;
Dwarf_Half version;
uint64_t op_index_register;
Dwarf_Small maximum_operations_per_instruction;
diff --git a/gprofng/src/Experiment.cc b/gprofng/src/Experiment.cc
index a23c10c..c797724 100644
--- a/gprofng/src/Experiment.cc
+++ b/gprofng/src/Experiment.cc
@@ -644,7 +644,7 @@ Experiment::ExperimentHandler::startElement (char*, char*, char *qName, Attribut
exp->exp_start_time = ts;
str = attrs->getValue (NTXT ("time"));
if (str != NULL)
- exp->start_sec = atol (str);
+ exp->start_sec = atoll (str);
str = attrs->getValue (NTXT ("pid"));
if (str != NULL)
exp->pid = atoi (str);
@@ -4136,7 +4136,8 @@ Experiment::write_header ()
if (dbeSession->ipc_mode || dbeSession->rdt_mode)
{
// In GUI: print start time at the beginning
- char *start_time = ctime (&start_sec);
+ time_t t = (time_t) start_sec;
+ char *start_time = ctime (&t);
if (start_time != NULL)
{
sb.setLength (0);
@@ -4258,7 +4259,8 @@ Experiment::write_header ()
}
// add comment for start time
- char *p = ctime (&start_sec);
+ time_t t = (time_t) start_sec;
+ char *p = ctime (&t);
sb.setLength (0);
if (p != NULL)
sb.sprintf (GTXT ("Experiment started %s"), p);
@@ -6444,9 +6446,11 @@ Experiment::dump_map (FILE *outfile)
load.tv_nsec += NANOSEC;
}
fprintf (outfile,
- "0x%08llx %8lld (0x%08llx) %5ld.%09ld %5ld.%09ld \"%s\"\n",
- s->base, s->size, s->size, load.tv_sec, load.tv_nsec,
- unload.tv_sec, unload.tv_nsec, s->obj->get_name ());
+ "0x%08llx %8lld (0x%08llx) %5lld.%09lld %5lld.%09lld \"%s\"\n",
+ (long long) s->base, (long long) s->size, (long long) s->size,
+ (long long) load.tv_sec, (long long) load.tv_nsec,
+ (long long) unload.tv_sec, (long long) unload.tv_nsec,
+ s->obj->get_name ());
}
fprintf (outfile, NTXT ("\n"));
}
diff --git a/gprofng/src/Experiment.h b/gprofng/src/Experiment.h
index 41c44e4..17c91bd 100644
--- a/gprofng/src/Experiment.h
+++ b/gprofng/src/Experiment.h
@@ -114,7 +114,7 @@ public:
// Configuration Information
char *hostname; // Hosthame (e.g. mymachine)
- long start_sec; // Starting timeval secs.
+ hrtime_t start_sec; // Starting timeval secs.
char *username; // name of person performing the test
char *architecture; // Architecture name ("sun4")
Platform_t platform; // Sparc,Sparcv9,Intel
diff --git a/gprofng/src/ipc.cc b/gprofng/src/ipc.cc
index 932423c..edc7025 100644
--- a/gprofng/src/ipc.cc
+++ b/gprofng/src/ipc.cc
@@ -1281,7 +1281,7 @@ ipc_doWork (void *arg)
{
int arg1 = readInt (req);
uint64_t arg2 = readLong (req);
- ipc_log (" args = %d, %ld\n", arg1, arg2);
+ ipc_log (" args = %d, %lld\n", arg1, (long long) arg2);
dbeSetSelObjV2 (arg1, arg2);
writeString (NULL, req);
}