diff options
author | Xavier Raynaud | 2011-01-03 09:09:56 +0000 |
---|---|---|
committer | Xavier Raynaud | 2011-01-03 09:09:56 +0000 |
commit | a1349585c8c33c4951782f25cb8ef6cd5985b429 (patch) | |
tree | 4807ee84900c6006a31fe2f9ce47164a3a954357 /gprof/org.eclipse.linuxtools.gprof | |
parent | e72c5bd18f98c48bc6103652caa1a482c52acb77 (diff) | |
download | org.eclipse.linuxtools-a1349585c8c33c4951782f25cb8ef6cd5985b429.tar.gz org.eclipse.linuxtools-a1349585c8c33c4951782f25cb8ef6cd5985b429.tar.xz org.eclipse.linuxtools-a1349585c8c33c4951782f25cb8ef6cd5985b429.zip |
fix https://bugs.eclipse.org/bugs/show_bug.cgi?id=332269
Diffstat (limited to 'gprof/org.eclipse.linuxtools.gprof')
-rw-r--r-- | gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/gprof/view/fields/SampleProfField.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/gprof/view/fields/SampleProfField.java b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/gprof/view/fields/SampleProfField.java index 54ac658ecb..88485af66a 100644 --- a/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/gprof/view/fields/SampleProfField.java +++ b/gprof/org.eclipse.linuxtools.gprof/src/org/eclipse/linuxtools/gprof/view/fields/SampleProfField.java @@ -120,22 +120,33 @@ public class SampleProfField extends AbstractSTDataViewersField implements IChar { long timeInNs = (long) (i/prof_rate); long ns = timeInNs%1000; - long timeInUs = timeInNs/1000; if (timeInUs == 0) return ns + "ns"; long us = timeInUs%1000; long timeInMs = timeInUs/1000; - if (timeInMs == 0) return us + "." + ns + "us"; + if (timeInMs == 0) { + String ns_s = "" + ns; + while (ns_s.length() < 3) ns_s = "0" + ns_s; + return us + "." + ns_s + "us"; + } long ms = timeInMs%1000; long timeInS = timeInMs/1000; - if (timeInS == 0) return ms + "." + us + "ms"; + if (timeInS == 0) { + String us_s = "" + us; + while (us_s.length() < 3) us_s = "0" + us_s; + return ms + "." + us_s + "ms"; + } long s = timeInS%60; long timeInMin = timeInS/60; - if (timeInMin == 0) return s + "." + ms + "s"; + if (timeInMin == 0) { + String ms_s = "" + ms; + while (ms_s.length() < 3) ms_s = "0" + ms_s; + return s + "." + ms_s + "s"; + } long min = timeInMin%60; long timeInHour = timeInMin/60; |