diff options
Diffstat (limited to 'gprofng/src')
-rw-r--r-- | gprofng/src/DbeSession.cc | 11 | ||||
-rw-r--r-- | gprofng/src/DbeSession.h | 1 | ||||
-rw-r--r-- | gprofng/src/Experiment.cc | 9 | ||||
-rw-r--r-- | gprofng/src/Experiment.h | 1 | ||||
-rw-r--r-- | gprofng/src/LoadObject.cc | 1 | ||||
-rw-r--r-- | gprofng/src/LoadObject.h | 1 |
6 files changed, 20 insertions, 4 deletions
diff --git a/gprofng/src/DbeSession.cc b/gprofng/src/DbeSession.cc index f3426ce..b0aa745 100644 --- a/gprofng/src/DbeSession.cc +++ b/gprofng/src/DbeSession.cc @@ -2017,6 +2017,17 @@ DbeSession::is_omp_available () } bool +DbeSession::is_bigendian () +{ +#ifdef WORDS_BIGENDIAN + return true; +#else + return false; +#endif + +} + +bool DbeSession::has_java () { int status_has_java = 0; diff --git a/gprofng/src/DbeSession.h b/gprofng/src/DbeSession.h index 5cbddae..7db0998 100644 --- a/gprofng/src/DbeSession.h +++ b/gprofng/src/DbeSession.h @@ -120,6 +120,7 @@ public: bool is_timeline_available (); bool is_ifreq_available (); bool is_omp_available (); + static bool is_bigendian (); bool has_java (); bool has_ompavail (); diff --git a/gprofng/src/Experiment.cc b/gprofng/src/Experiment.cc index 45550e8..4cbb7f6 100644 --- a/gprofng/src/Experiment.cc +++ b/gprofng/src/Experiment.cc @@ -541,10 +541,14 @@ Experiment::ExperimentHandler::startElement (char*, char*, char *qName, Attribut exp->platform = RISCV; else exp->platform = Sparc; - exp->need_swap_endian = (DbeSession::platform == Sparc) ? - (exp->platform != Sparc) : (exp->platform == Sparc); exp->architecture = xstrdup (str); } + str = attrs->getValue (NTXT ("bigendian")); + if (str != NULL) + { + exp->bigendian = *str == '1'; + exp->need_swap_endian = DbeSession::is_bigendian () != exp->bigendian; + } str = attrs->getValue (NTXT ("pagesz")); if (str != NULL) exp->page_size = atoi (str); @@ -1314,6 +1318,7 @@ Experiment::Experiment () exp_maj_version = 0; exp_min_version = 0; platform = Unknown; + bigendian = DbeSession::is_bigendian(); // can be changed in log.xml reading wsize = Wnone; page_size = 4096; npages = 0; diff --git a/gprofng/src/Experiment.h b/gprofng/src/Experiment.h index 2047a15..c85aadd 100644 --- a/gprofng/src/Experiment.h +++ b/gprofng/src/Experiment.h @@ -135,6 +135,7 @@ public: // for current experiment, i.e. 8 for 32bit addresses int broken; // If SP_JCMD_RUN line not seen int obsolete; // If pointer file experiment detected + bool bigendian; // the experiment was created on a big_endian machine bool hwc_default; // True if HW counters were enabled by default int hwc_bogus; // Count of bogus HWC packets int hwc_lost_int; // Count of packets reflecting lost interrupt diff --git a/gprofng/src/LoadObject.cc b/gprofng/src/LoadObject.cc index 3cdeb9d..bf49e9d 100644 --- a/gprofng/src/LoadObject.cc +++ b/gprofng/src/LoadObject.cc @@ -87,7 +87,6 @@ LoadObject::LoadObject (const char *loname) size = 0; type = SEG_UNKNOWN; isReadStabs = false; - need_swap_endian = false; instHTable = new DbeInstr*[LO_InstHTableSize]; for (int i = 0; i < LO_InstHTableSize; i++) instHTable[i] = NULL; diff --git a/gprofng/src/LoadObject.h b/gprofng/src/LoadObject.h index 14dfe26..dd40ea0 100644 --- a/gprofng/src/LoadObject.h +++ b/gprofng/src/LoadObject.h @@ -167,7 +167,6 @@ public: unsigned int flags; // SEG_FLAG_* bool isReadStabs; - bool need_swap_endian; int seg_idx; // for compatibility (ADDRESS) seg_type type; int64_t size; // size of loadobject in bytes |