]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix 32097 Warnings when building gprofng with Clang
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Wed, 4 Sep 2024 04:30:31 +0000 (21:30 -0700)
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Wed, 4 Sep 2024 20:49:21 +0000 (13:49 -0700)
gprofng/ChangeLog
2024-09-03  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>.

PR gprofng/32097
* common/hwcdrv.c: Fix -Wempty-body warnings.
* common/hwcentry.h: Fix -Wdeprecated-non-prototype warnings.
* common/hwctable.c: Fix -Wdeprecated-non-prototype warnings.
* libcollector/collector.c: Likewise.
* libcollector/collector.h: Likewise.
* libcollector/collectorAPI.c: Likewise.
* libcollector/dispatcher.c: Likewise.
* libcollector/iotrace.c: Likewise.
* libcollector/libcol_util.c: Fix -Wunused-but-set-variable warnings.
* libcollector/libcol_util.h: Remove unused declarations.
* libcollector/linetrace.c: Fix -Wdeprecated-non-prototype warnings.
* src/BaseMetricTreeNode.h: Fix -Wunused-private-field warnings.
* src/Dbe.cc: Fix -Wself-assign warnings.
* src/DbeSession.cc: Fix -Wunused-but-set-variable warnings.
* src/Disasm.cc: Fix -Wunused-const-variable warnings.
* src/Experiment.cc: Fix -Wunused-private-field warnings.
* src/HashMap.h: Fix -Wself-assign warnings.
* src/IOActivity.h: Fix -Wunused-private-field warnings.
* src/collctrl.cc: Fix -Wself-assign, -Wparentheses-equality warnings.
* src/collctrl.h: Fix -Wunused-private-field warnings.
* src/collector_module.h: Fix -Wdeprecated-non-prototype warnings.
* src/gp-display-src.cc: Fix -Wunused-private-field warnings.
* src/gp-print.h: Fix -Wheader-guard warnings.
* src/hwc_intel_icelake.h: Fix -Winitializer-overrides warnings.
* src/util.cc: Fix -Wunused-but-set-variable warnings.

25 files changed:
gprofng/common/hwcdrv.c
gprofng/common/hwcentry.h
gprofng/common/hwctable.c
gprofng/libcollector/collector.c
gprofng/libcollector/collector.h
gprofng/libcollector/collectorAPI.c
gprofng/libcollector/dispatcher.c
gprofng/libcollector/iotrace.c
gprofng/libcollector/libcol_util.c
gprofng/libcollector/libcol_util.h
gprofng/libcollector/linetrace.c
gprofng/src/BaseMetricTreeNode.h
gprofng/src/Dbe.cc
gprofng/src/DbeSession.cc
gprofng/src/Disasm.cc
gprofng/src/Experiment.cc
gprofng/src/HashMap.h
gprofng/src/IOActivity.h
gprofng/src/collctrl.cc
gprofng/src/collctrl.h
gprofng/src/collector_module.h
gprofng/src/gp-display-src.cc
gprofng/src/gp-print.h
gprofng/src/hwc_intel_icelake.h
gprofng/src/util.cc

index aaf3acdf9cd9188d08eb85b90ccbc2117be3e7f5..51492a8d35cdb752157eb42c98c37c92824b8e57 100644 (file)
@@ -574,6 +574,7 @@ read_sample (counter_state_t *ctr_state, int msgsz, uint64_t *rvalue,
 static void
 dump_perf_event_attr (struct perf_event_attr *at)
 {
+#if defined(DEBUG)
   TprintfT (DBG_LT2, "dump_perf_event_attr:  size=%d  type=%d  sample_period=%lld\n"
            "  config=0x%llx  config1=0x%llx  config2=0x%llx  wakeup_events=%lld __reserved_1=%lld\n",
            (int) at->size, (int) at->type, (unsigned long long) at->sample_period,
@@ -589,13 +590,13 @@ dump_perf_event_attr (struct perf_event_attr *at)
   DUMP_F (exclude_kernel);
   DUMP_F (exclude_hv);
   DUMP_F (exclude_idle);
-  //    DUMP_F(xmmap);
   DUMP_F (comm);
   DUMP_F (freq);
   DUMP_F (inherit_stat);
   DUMP_F (enable_on_exec);
   DUMP_F (task);
   DUMP_F (watermark);
+#endif
 }
 
 static void
index b2ab8b9b22cdf4b5b9a7a74ab383979ae0ad92bc..0b923fc35769e1dc780c9a10c992047e4efd9856 100644 (file)
@@ -200,17 +200,12 @@ extern "C"
   extern char *hwc_get_docref (char *buf, size_t buflen);
   /* Return a CPU HWC document reference, or NULL. */
 
-  // TBR
-  extern char *hwc_get_default_cntrs ();
-  /* Return a default HW counter string; may be NULL, or zero-length */
-  /* NULL means none is defined in the table; or zero-length means string defined could not be loaded */
-
   extern char *hwc_get_default_cntrs2 (int forKernel, int style);
   /* like hwc_get_default_cntrs() for style==1 */
   /* but allows other styles of formatting as well */
   /* deprecate and eventually remove hwc_get_default_cntrs() */
 
-  extern char *hwc_get_orig_default_cntrs ();
+  extern char *hwc_get_orig_default_cntrs (int forKernel);
   /* Get the default HW counter string as set in the table */
   /* NULL means none is defined in the table */
 
index 9ee932e301ed6125ef85599c4f074fbe216056c2..890915354e1e665064b981d64ad77eb13b14cd7e 100644 (file)
@@ -1792,7 +1792,7 @@ check_tables ()
 }
 #endif
 
-static int try_a_counter ();
+static int try_a_counter (int forKernel);
 static void hwc_process_raw_ctrs (int forKernel, Hwcentry ***pstd_out,
                                  Hwcentry ***praw_out, Hwcentry ***phidden_out,
                                  Hwcentry**static_tables,
@@ -2840,17 +2840,6 @@ hwc_get_docref (char *buf, size_t buflen)
   return buf;
 }
 
-//TBR:
-
-extern char*
-hwc_get_default_cntrs ()
-{
-  setup_cpcx ();
-  if (cpcx_default_hwcs[0] != NULL)
-    return strdup (cpcx_default_hwcs[0]); // TBR deprecate this
-  return NULL;
-}
-
 extern char*
 hwc_get_default_cntrs2 (int forKernel, int style)
 {
index 3a8f27a719d9496de55373e7051dde9a09150db2..2ff95e58fdee884563cd1e89e7b63bbdc25a0b8a 100644 (file)
@@ -210,15 +210,10 @@ get_collector_interface ()
 static void
 collector_module_init (CollectorInterface *col_intf)
 {
-  int nmodules = 0;
-
   ModuleInitFunc next_init = (ModuleInitFunc) dlsym (RTLD_DEFAULT, "__collector_module_init");
   if (next_init != NULL)
-    {
-      nmodules++;
-      next_init (col_intf);
-    }
-  TprintfT (DBG_LT1, "collector_module_init: %d modules\n", nmodules);
+    next_init (col_intf);
+  TprintfT (DBG_LT1, "collector_module_init: %d modules\n", next_init ? 1 : 0);
 }
 
 /*   Routines concerned with general experiment start and stop */
@@ -1783,7 +1778,7 @@ __collector_pause ()
 }
 
 void
-__collector_pause_m (char *reason)
+__collector_pause_m (const char *reason)
 {
   hrtime_t now;
   char xreason[MAXPATHLEN];
@@ -2449,8 +2444,8 @@ __collector_dlog (int tflag, int level, char *format, ...)
 
 static void (*__real__exit) (int status) = NULL; /* libc only: _exit */
 static void (*__real__Exit) (int status) = NULL; /* libc only: _Exit */
-void _exit () __attribute__ ((weak, alias ("__collector_exit")));
-void _Exit () __attribute__ ((weak, alias ("__collector_Exit")));
+void _exit (int status) __attribute__ ((weak, alias ("__collector_exit")));
+void _Exit (int status) __attribute__ ((weak, alias ("__collector_Exit")));
 
 void
 __collector_exit (int status)
index 07a03bdd17a716d8cbfe8c44a11f24a27b117b6a..eda68a0e4f538ed36f55ae3beccbb5af5e03b307 100644 (file)
@@ -123,7 +123,7 @@ extern void __collector_terminate_expt ();
 extern void __collector_terminate_hook ();
 extern void __collector_sample (char *name);
 extern void __collector_pause ();
-extern void __collector_pause_m ();
+extern void __collector_pause_m (const char *reason);
 extern void __collector_resume ();
 extern int collector_sigemt_sigaction (const struct sigaction*,
                                       struct sigaction*);
index 5fa6403ad490301c97d5acecc34c15868b584417..449bbbaab6574af58186717157dc20834dd16c51 100644 (file)
 #include "collectorAPI.h"
 #include "gp-experiment.h"
 
-static void *__real_collector_sample = NULL;
-static void *__real_collector_pause = NULL;
-static void *__real_collector_resume = NULL;
-static void *__real_collector_terminate_expt = NULL;
-static void *__real_collector_func_load = NULL;
-static void *__real_collector_func_unload = NULL;
+static void (*__real_collector_sample)(const char *) = NULL;
+static void (*__real_collector_pause)() = NULL;
+static void (*__real_collector_resume)() = NULL;
+static void (*__real_collector_terminate_expt)() = NULL;
+static void (*__real_collector_func_load)(const char *, const char *,
+               const char *, void *, int, int, Lineno *) = NULL;
+static void (*__real_collector_func_unload)(void *) = NULL;
 
 #define INIT_API        if (init_API == 0) collectorAPI_initAPI()
 #define NULL_PTR(x)     (__real_##x == NULL)
-#define CALL_REAL(x)    (*(void(*)())__real_##x)
+#define CALL_REAL(x)    (__real_##x)
 #define CALL_IF_REAL(x) INIT_API; if (!NULL_PTR(x)) CALL_REAL(x)
 
 static int init_API = 0;
index 8b8ad77b5ee72415886b7e33ad58bca44f7a6110..f7cd46e7e6beb4cad2780be40f9766c1108600a0 100644 (file)
@@ -908,8 +908,9 @@ sigset (int sig, sighandler_t handler)
 
 // map interposed symbol versions
 static int
-gprofng_timer_create (int (real_func) (), clockid_t clockid,
-                      struct sigevent *sevp, timer_t *timerid)
+gprofng_timer_create (int (real_func) (clockid_t, struct sigevent *, timer_t *),
+                     clockid_t clockid,
+                     struct sigevent *sevp, timer_t *timerid)
 {
   // collector reserves SIGPROF
   if (sevp == NULL || sevp->sigev_notify != SIGEV_SIGNAL ||
@@ -1044,7 +1045,7 @@ __collector_thr_sigsetmask (int how, const sigset_t* iset, sigset_t* oset)
 // map interposed symbol versions
 
 static int
-gprofng_pthread_sigmask (int (real_func) (),
+gprofng_pthread_sigmask (int (real_func) (int, const sigset_t *, sigset_t*),
                          int how, const sigset_t *iset, sigset_t* oset)
 {
   sigset_t lsigset;
@@ -1139,9 +1140,10 @@ collector_root (void *cargs)
 // map interposed symbol versions
 
 static int
-gprofng_pthread_create (int (real_func) (), pthread_t *thread,
-                        const pthread_attr_t *attr,
-                        void *(*func)(void*), void *arg)
+gprofng_pthread_create (int (real_func) (pthread_t *, const pthread_attr_t *,
+                                        void *(*)(void *), void *),
+                       pthread_t *thread, const pthread_attr_t *attr,
+                       void *(*func)(void*), void *arg)
 {
   TprintfT (DBG_LTT, "gprofng_pthread_create @%p\n", real_func);
   if (dispatch_mode != DISPATCH_ON)
@@ -1276,6 +1278,7 @@ __collector_ext_clone_pthread (int (*fn)(void *), void *child_stack, int flags,
 }
 
 // weak symbols:
-int sigprocmask () __attribute__ ((weak, alias ("__collector_sigprocmask")));
-int thr_sigsetmask () __attribute__ ((weak, alias ("__collector_thr_sigsetmask")));
+int sigprocmask (int, const sigset_t*, sigset_t*) __attribute__ ((weak, alias ("__collector_sigprocmask")));
+int thr_sigsetmask (int, const sigset_t*, sigset_t*) __attribute__ ((weak, alias ("__collector_thr_sigsetmask")));
 int setitimer () __attribute__ ((weak, alias ("_setitimer")));
+
index 18060864796b568064634ab3bacec4b56613c809..3deb441d9c7177be1b81c020cf7ab99307860957 100644 (file)
@@ -1350,7 +1350,7 @@ mkstemp (char *template)
   unsigned pktSize;
   if (NULL_PTR (mkstemp))
     init_io_intf ();
-  if (CHCK_REENTRANCE (guard) || template == NULL)
+  if (CHCK_REENTRANCE (guard))
     return CALL_REAL (mkstemp)(template);
   PUSH_REENTRANCE (guard);
   hrtime_t reqt = gethrtime ();
@@ -1405,7 +1405,7 @@ mkstemps (char *template, int slen)
   unsigned pktSize;
   if (NULL_PTR (mkstemps))
     init_io_intf ();
-  if (CHCK_REENTRANCE (guard) || template == NULL)
+  if (CHCK_REENTRANCE (guard))
     return CALL_REAL (mkstemps)(template, slen);
   PUSH_REENTRANCE (guard);
   hrtime_t reqt = gethrtime ();
@@ -1485,7 +1485,7 @@ close (int fildes)
 
 /*------------------------------------------------------------- fopen */
 static FILE*
-gprofng_fopen (FILE*(real_fopen) (), const char *filename, const char *mode)
+gprofng_fopen (FILE*(real_fopen) (const char *, const char *), const char *filename, const char *mode)
 {
   int *guard;
   FILE *fp = NULL;
@@ -1559,7 +1559,7 @@ DCL_FOPEN (fopen)
 
 /*------------------------------------------------------------- fclose */
 static int
-gprofng_fclose (int(real_fclose) (), FILE *stream)
+gprofng_fclose (int(real_fclose) (FILE *), FILE *stream)
 {
   int *guard;
   int stat;
@@ -1645,7 +1645,7 @@ fflush (FILE *stream)
 
 /*------------------------------------------------------------- fdopen */
 static FILE*
-gprofng_fdopen (FILE*(real_fdopen) (), int fildes, const char *mode)
+gprofng_fdopen (FILE*(real_fdopen) (int, const char *), int fildes, const char *mode)
 {
   int *guard;
   FILE *fp = NULL;
@@ -2957,7 +2957,7 @@ DCL_FGETPOS (fgetpos)
 
 /*------------------------------------------------------------- fgetpos64 */
 static int
-gprofng_fgetpos64 (int(real_fgetpos64) (), FILE *stream, fpos64_t *pos)
+gprofng_fgetpos64 (int(real_fgetpos64) (FILE *, fpos64_t *), FILE *stream, fpos64_t *pos)
 {
   int *guard;
   int ret;
index 1e58cf491a17afd9734fe751ae2fe1353183c33b..baac15db5c493dba3232a2025c7dc2141584aff3 100644 (file)
@@ -1013,7 +1013,6 @@ __collector_open (const char *path, int oflag, ...)
   mode_t mode = 0;
 
   hrtime_t t_timeout = __collector_gethrtime () + 5 * ((hrtime_t) NANOSEC);
-  int nretries = 0;
   long long delay = 100; /* start at some small, arbitrary value */
 
   /* get optional mode argument if it's expected/required */
@@ -1058,7 +1057,6 @@ __collector_open (const char *path, int oflag, ...)
       delay *= 2;
       if (delay > 100000000)
        delay = 100000000; /* cap at some large, arbitrary value */
-      nretries++;
     }
   return fd;
 }
index c8ec83ff0d942225282adc2f927f7e8867daab29..aa30db72bcce6831a64d3cba90a6fa9763ca1024 100644 (file)
@@ -81,12 +81,6 @@ extern int __collector_mutex_trylock (collector_mutex_t *mp);
 #define __collector_mutex_init(xx) \
   do { collector_mutex_t tmp=COLLECTOR_MUTEX_INITIALIZER; *(xx)=tmp; } while(0)
 
-void __collector_sample (char *name);
-void __collector_terminate_expt ();
-void __collector_pause ();
-void __collector_pause_m ();
-void __collector_resume ();
-
 struct DT_lineno;
 
 typedef enum
index 67b2d7e903084f375f2b74a66b0869cc547dea21..66844bc1337b2442418d4bc4d1df87e32598f9ab 100644 (file)
@@ -1207,7 +1207,7 @@ __collector_vfork (void)
 }
 
 /*------------------------------------------------------------- execve */
-int execve () __attribute__ ((weak, alias ("__collector_execve")));
+int execve (const char *, char *const [], char *const []) __attribute__ ((weak, alias ("__collector_execve")));
 
 int
 __collector_execve (const char* path, char *const argv[], char *const envp[])
@@ -1237,7 +1237,7 @@ __collector_execve (const char* path, char *const argv[], char *const envp[])
   return ret;
 }
 
-int execvp () __attribute__ ((weak, alias ("__collector_execvp")));
+int execvp (const char *, char *const []) __attribute__ ((weak, alias ("__collector_execvp")));
 
 int
 __collector_execvp (const char* file, char *const argv[])
@@ -1269,7 +1269,7 @@ __collector_execvp (const char* file, char *const argv[])
   return ret;
 }
 
-int execv () __attribute__ ((weak, alias ("__collector_execv")));
+int execv (const char *, char *const []) __attribute__ ((weak, alias ("__collector_execv")));
 
 int
 __collector_execv (const char* path, char *const argv[])
@@ -1408,7 +1408,10 @@ __collector_execl (const char* path, const char *arg0, ...)
 /*-------------------------------------------------------- posix_spawn */
 // map interposed symbol versions
 static int
-gprofng_posix_spawn (int(real_posix_spawn) (),
+gprofng_posix_spawn (int(real_posix_spawn) (pid_t *, const char *,
+                               const posix_spawn_file_actions_t *,
+                               const posix_spawnattr_t *,
+                               char *const [], char *const []),
                     pid_t *pidp, const char *path,
                     const posix_spawn_file_actions_t *file_actions,
                     const posix_spawnattr_t *attrp,
@@ -1466,7 +1469,10 @@ DCL_POSIX_SPAWN (posix_spawn)
 
 /*-------------------------------------------------------- posix_spawnp */
 static int
-gprofng_posix_spawnp (int (real_posix_spawnp) (),
+gprofng_posix_spawnp (int (real_posix_spawnp) (pid_t *, const char *,
+                               const posix_spawn_file_actions_t *,
+                               const posix_spawnattr_t *,
+                               char *const [], char *const []),
                       pid_t *pidp, const char *path,
                       const posix_spawn_file_actions_t *file_actions,
                       const posix_spawnattr_t *attrp,
@@ -1754,8 +1760,8 @@ __collector_clone (int (*fn)(void *), void *child_stack, int flags, void *arg,
 }
 
 /*-------------------------------------------------------------------- setuid */
-int setuid () __attribute__ ((weak, alias ("__collector_setuid")));
-int _setuid () __attribute__ ((weak, alias ("__collector_setuid")));
+int setuid (uid_t) __attribute__ ((weak, alias ("__collector_setuid")));
+int _setuid (uid_t) __attribute__ ((weak, alias ("__collector_setuid")));
 
 int
 __collector_setuid (uid_t ruid)
@@ -1770,8 +1776,8 @@ __collector_setuid (uid_t ruid)
 }
 
 /*------------------------------------------------------------------- seteuid */
-int seteuid () __attribute__ ((weak, alias ("__collector_seteuid")));
-int _seteuid () __attribute__ ((weak, alias ("__collector_seteuid")));
+int seteuid (uid_t) __attribute__ ((weak, alias ("__collector_seteuid")));
+int _seteuid (uid_t) __attribute__ ((weak, alias ("__collector_seteuid")));
 
 int
 __collector_seteuid (uid_t euid)
@@ -1786,8 +1792,8 @@ __collector_seteuid (uid_t euid)
 }
 
 /*------------------------------------------------------------------ setreuid */
-int setreuid () __attribute__ ((weak, alias ("__collector_setreuid")));
-int _setreuid () __attribute__ ((weak, alias ("__collector_setreuid")));
+int setreuid (uid_t, uid_t) __attribute__ ((weak, alias ("__collector_setreuid")));
+int _setreuid (uid_t, uid_t) __attribute__ ((weak, alias ("__collector_setreuid")));
 
 int
 __collector_setreuid (uid_t ruid, uid_t euid)
@@ -1802,8 +1808,8 @@ __collector_setreuid (uid_t ruid, uid_t euid)
 }
 
 /*-------------------------------------------------------------------- setgid */
-int setgid () __attribute__ ((weak, alias ("__collector_setgid")));
-int _setgid () __attribute__ ((weak, alias ("__collector_setgid")));
+int setgid (gid_t) __attribute__ ((weak, alias ("__collector_setgid")));
+int _setgid (gid_t) __attribute__ ((weak, alias ("__collector_setgid")));
 
 int
 __collector_setgid (gid_t rgid)
@@ -1818,8 +1824,8 @@ __collector_setgid (gid_t rgid)
 }
 
 /*------------------------------------------------------------------- setegid */
-int setegid () __attribute__ ((weak, alias ("__collector_setegid")));
-int _setegid () __attribute__ ((weak, alias ("__collector_setegid")));
+int setegid (gid_t) __attribute__ ((weak, alias ("__collector_setegid")));
+int _setegid (gid_t) __attribute__ ((weak, alias ("__collector_setegid")));
 
 int
 __collector_setegid (gid_t egid)
@@ -1834,8 +1840,8 @@ __collector_setegid (gid_t egid)
 }
 
 /*------------------------------------------------------------------ setregid */
-int setregid () __attribute__ ((weak, alias ("__collector_setregid")));
-int _setregid () __attribute__ ((weak, alias ("__collector_setregid")));
+int setregid (gid_t, gid_t) __attribute__ ((weak, alias ("__collector_setregid")));
+int _setregid (gid_t, gid_t) __attribute__ ((weak, alias ("__collector_setregid")));
 
 int
 __collector_setregid (gid_t rgid, gid_t egid)
index d73d244e27e2dd46be60e7a8227dbc1f70c4c618..7698f9c6eaf6526a2713ca9e243fdfaa8c175f0a 100644 (file)
@@ -85,7 +85,6 @@ private:
 
   BaseMetricTreeNode *root;     // root of tree
   BaseMetricTreeNode *parent;   // my parent
-  bool aggregation;             // value is based on children's values
   char *name;           // bm->get_cmd() for metrics, unique string otherwise
   char *uname;                  // user-visible text
   char *unit;                   // see UNIT_* defines
index 95daa7271865d6956c4ec063ee0c7ef1ed7f2a35..09b7f94eaa8e3fbf10a8fd38764bc23e13df76a4 100644 (file)
@@ -9591,14 +9591,12 @@ dbeGetTLDataRepVals (VMode view_mode, hrtime_t start_ts, hrtime_t delta,
        }
       if (sampleVals != NULL)
        {
-         Sample* sample = (Sample*) packets->getObjValue (PROP_SMPLOBJ, packetIdx);
-         if (!sample || !sample->get_usage ())
-           sample = sample;
-         else
+         Sample *sample = (Sample*) packets->getObjValue (PROP_SMPLOBJ, packetIdx);
+         if (sample != NULL)
            {
-             PrUsageprusage = sample->get_usage ();
-             Vector<long long> *mstateVals = prusage->getMstateValues ();
-             sampleVals->store (eventIdx, mstateVals);
+             PrUsage *prusage = sample->get_usage ();
+             if (prusage != NULL)
+               sampleVals->store (eventIdx, prusage->getMstateValues ());
            }
        }
     }
index a6808d8d8f669cec85d01e0ab17124ab4eb8a54c..3649357bc797861df372e0dd9e4c0e6ea6542fc7 100644 (file)
@@ -1164,8 +1164,6 @@ DbeSession::open_experiment (Experiment *exp, char *path)
   closedir (exp_dir);
   exp_names->sort (dir_name_cmp);
   Experiment **t_exp_list = new Experiment *[exp_names->size ()];
-  int nsubexps = 0;
-
   for (int j = 0, jsz = exp_names->size (); j < jsz; j++)
     {
       t_exp_list[j] = NULL;
@@ -1222,7 +1220,6 @@ DbeSession::open_experiment (Experiment *exp, char *path)
        dexp->open (dpath);
       append (dexp);
       t_exp_list[j] = dexp;
-      nsubexps++;
       dexp->set_clock (exp->clock);
 
       // DbeView add_experiment() is split into two parts
index e41bf67929263c739601becb1807b2a12ef16b0f..19f2174d536fed1aea2975f761b7f23b1641a06a 100644 (file)
@@ -49,7 +49,6 @@ struct DisContext
 };
 
 static const int MAX_DISASM_STR     = 2048;
-static const int MAX_INSTR_SIZE     = 8;
 
 Disasm::Disasm (char *fname)
 {
index a1f78fc0cde94e2fd87e0ea94671dac0e7cbe20e..627a755c88cff265c3a5ec74adc96f01ace49543 100644 (file)
@@ -1937,8 +1937,6 @@ private:
   }
 
   Experiment *exp;
-  char *hostname;
-  hrtime_t time, tstamp;
 };
 
 void
index 918c0dc95f9bcf1f94e379ce32f09b2157b5ef4c..c5fdd345ba877f737654addbed363c78036e763c 100644 (file)
@@ -78,9 +78,8 @@ copy_key (uint64_t a)
 }
 
 template<> inline void
-delete_key (uint64_t a)
+delete_key (uint64_t)
 {
-  a = a;
 }
 
 template<> inline int
index cf462cf8d554040b785f39a25f3c39810c115b95..f3a22ada6b151879bf3a94063b0bca3248504dc0 100644 (file)
@@ -78,7 +78,6 @@ private:
   Hist_data *hist_data_file_all;
   Hist_data *hist_data_vfd_all;
   Hist_data *hist_data_callstack_all;
-  Hist_data *hist_data_callstack;
 
   DbeView *dbev;
 };
index 95324fbd5a620537600023369679a02f1352f1c2..d341cb00fcacc639fb78586a12ab6e8f15feff3a 100644 (file)
@@ -876,9 +876,7 @@ Coll_Ctrl::set_clkprof (const char *string, char** warn)
       double dval = strtod (string, &endchar);
       if (*endchar == 'm' || *endchar == 0) /* user specified milliseconds */
        dval = dval * 1000.;
-      else if (*endchar == 'u') /* user specified microseconds */
-       dval = dval;
-      else
+      else if (*endchar != 'u')
        return dbe_sprintf (GTXT ("Unrecognized clock-profiling interval `%s'\n"), string);
       nclkprof_timer = (int) (dval + 0.5);
     }
@@ -2788,7 +2786,7 @@ Coll_Ctrl::get (char * control)
     }
   if (!strncmp (control, ipc_str_javaprof, len))
     {
-      if ((java_mode == 0))
+      if (java_mode == 0)
        return strdup (ipc_str_off);
       return strdup (ipc_str_on);
     }
@@ -2804,7 +2802,7 @@ Coll_Ctrl::get (char * control)
     }
   if (!strncmp (control, ipc_str_sample_sig, len))
     {
-      if ((sample_sig == 0))
+      if (sample_sig == 0)
        return strdup (ipc_str_off);
       char *str_signal = find_signal_name (sample_sig);
       if (str_signal != NULL)
@@ -2838,15 +2836,15 @@ Coll_Ctrl::get (char * control)
     }
   if (!strncmp (control, ipc_str_iotrace, len))
     {
-      if ((iotrace_enabled == 0))
+      if (iotrace_enabled == 0)
        return strdup (ipc_str_off);
       return strdup (ipc_str_on);
     }
   if (!strncmp (control, ipc_str_count, len))
     {
-      if ((count_enabled == 0))
+      if (count_enabled == 0)
        return strdup (ipc_str_off);
-      if ((count_enabled < 0))
+      if (count_enabled < 0)
        return strdup ("on\nstatic");
       return strdup (ipc_str_on);
     }
index 788df7a421f8fa9142a51ba62767576153968598..0a98f716e620fa37045bfa670606e12164b1aeac 100644 (file)
@@ -271,7 +271,6 @@ private:
   char *node_name;      /* name of machine on which experiment is run */
   long ncpus;           /* number of online CPUs */
   int cpu_clk_freq;     /* chip clock (MHz.), as reported from processor_info */
-  int cpc_cpuver;       /* chip version, as reported from libcpc */
   long sys_resolution;  /* system clock resolution */
   int sample_period;    /* period for sampling, seconds */
   int sample_default;    /* if period for sampling set by default */
index bb48eadb9f8ea53689b84d0189400e03a0cd1078..ebcdbca561f0b923c53218a2024faef9681175a2 100644 (file)
@@ -40,12 +40,12 @@ struct tm;
  * If you add any, please put it in the right place */
 typedef struct CollectorUtilFuncs
 {
-  int (*access)();
+  int (*access)(const char *, int);
   int (*atoi)(const char *nptr);
   void *(*calloc)(size_t nelem, size_t elsize);
   int (*clearenv)(void);
   int (*close)(int);
-  int (*closedir)();
+  int (*closedir)(DIR *);
   int (*execv)(const char *path, char *const argv[]);
   void (*exit)(int status);
   int (*fclose)(FILE *stream);
@@ -66,20 +66,20 @@ typedef struct CollectorUtilFuncs
   off_t (*lseek)(int fd, off_t offset, int whence);
   void *(*malloc)(size_t size);
   void *(*memset)(void *s1, int c, size_t n);
-  int (*mkdir)();
+  int (*mkdir)(const char *, mode_t);
   time_t (*mktime)(struct tm *timeptr);
   void *(*mmap)(void *, size_t, int, int, int, off_t);
-  void *(*mmap64_)();
-  int (*munmap)();
+  void *(*mmap64_)(void *, size_t, int, int, int, off_t);
+  int (*munmap)(void *, size_t);
   int (*open)(const char *, int, ...);
   int (*open_bare)(const char *, int, ...);
-  DIR *(*opendir)();
+  DIR *(*opendir)(const char *);
   int (*pclose)(FILE *stream);
   FILE *(*popen)(const char *command, const char *mode);
   int (*putenv)(char *string);
-  ssize_t (*pwrite)();
-  ssize_t (*pwrite64_)();
-  ssize_t (*read)();
+  ssize_t (*pwrite)(int, const void *, size_t, off_t);
+  ssize_t (*pwrite64_)(int, const void *, size_t, off_t);
+  ssize_t (*read)(int, void *, size_t);
   int (*setenv)(const char *name, const char *value, int overwrite);
   int (*sigfillset)(sigset_t *set);
   int (*sigprocmask)(int how, const sigset_t *set, sigset_t *oldset);
@@ -112,7 +112,7 @@ typedef struct CollectorUtilFuncs
   int (*unsetenv)(const char *name);
   int (*vsnprintf)(char *str, size_t size, const char *format, va_list ap);
   pid_t (*waitpid)(pid_t pid, int *stat_loc, int options);
-  ssize_t (*write)();
+  ssize_t (*write)(int, void *, size_t);
   double (*atof)();
   void *n_a;
 } CollectorUtilFuncs;
index 200e6080d2e3ce8c0245d7f8db3b2204186434b4..24af375edf153e06090d9e9f9e2779ad1fb791c5 100644 (file)
@@ -75,14 +75,6 @@ private:
   bool v_opt;
   int multiple;
   char *str_compcom;
-  bool hex_visible;
-  int src_visible;
-  int vis_src;
-  int vis_dis;
-  int threshold_src;
-  int threshold_dis;
-  int threshold;
-  int vis_bits;
 };
 
 static int
index 1b748ea60a360246d5a5bef96cb1690a333bba9f..1a8ad3b6c13e96ebd2f1926f8071128b5e842ef4 100644 (file)
@@ -19,7 +19,7 @@
    MA 02110-1301, USA.  */
 
 #ifndef _GP_PRINT_H
-#define _ER_PRINT_H
+#define _GP_PRINT_H
 
 #include "Command.h"
 #include "DbeApplication.h"
index 46f4ac5005f976f258ff22f864580edbc57ebbbf..4fe2e26f63bb96794f9650868d712ef218a1ab82 100644 (file)
 #define SH(val, n) (((unsigned long long) (val)) << n)
 #define I(nm, event, umask, edge, cmask, inv, \
          offcore_rsp, ldlat, frontend, period, mtr) \
-         INIT_HWC(nm, mtr, SH(event, 0) | SH(umask, 8) | SH(edge, 18) \
-                    | SH(cmask, 24) | SH(inv, 23), PERF_TYPE_RAW), \
+         .use_perf_event_type = 1, .type = PERF_TYPE_RAW, \
+         .name = (nm), .metric = (mtr), .reg_num = REGNO_ANY, \
+         .config = SH(event, 0) | SH(umask, 8) | SH(edge, 18) | SH(cmask, 24) \
+                 | SH(inv, 23), \
          .config1 = SH(offcore_rsp, 0) | SH(ldlat, 0) | SH(frontend, 0), \
          .val = period
 
index 201f7088b66ab7ae177beec5789e473d2c4f0da9..228140b61ae268881bdeba915faaf860c62b9cca 100644 (file)
@@ -741,17 +741,13 @@ get_relative_link (const char *path_from, const char *path_to)
   s2 = canonical_path (s2);
   long l = dbe_sstrlen (s1);
   // try to find common directories
-  int common_slashes = 0;
   int last_common_slash = -1;
   for (int i = 0; i < l; i++)
     {
-      if (s1[i] != s2[i]) break;
-      if (s1[i] == 0) break;
+      if (s1[i] != s2[i] || s1[i] == 0)
+       break;
       if (s1[i] == '/')
-       {
-         common_slashes++;
-         last_common_slash = i;
-       }
+       last_common_slash = i;
     }
   // find slashes in remaining path_to
   int slashes = 0;