os.linux.ui: Remove redundant query in ResourcesPresentationProvider
authorLoïc Prieur-Drevon <loic.prieurdrevon@gmail.com>
Fri, 15 Apr 2016 14:41:05 +0000 (10:41 -0400)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Mon, 18 Apr 2016 13:45:55 +0000 (09:45 -0400)
getEventHoverToolTipInfo would do a full state query then
a single query for each CPU/IRQ.
This patch replaces the single query by reading the full
state results.

Change-Id: I10959152e094674b8276608dddb2fe03368f1d96
Signed-off-by: Loïc Prieur-Drevon <loic.prieurdrevon@gmail.com>
Reviewed-on: https://git.eclipse.org/r/70765
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/resources/ResourcesPresentationProvider.java

index 2fb537db10abc7730ca9d60d7a36b4042f34ab28..1f93b7dea6b0d6b8274a94434e55547813bcdb64 100644 (file)
@@ -192,16 +192,14 @@ public class ResourcesPresentationProvider extends TimeGraphPresentationProvider
                             List<Integer> irqQuarks = ss.getQuarks(Attributes.CPUS, Integer.toString(cpu), Attributes.IRQS, "*"); //$NON-NLS-1$
 
                             for (int irqQuark : irqQuarks) {
-                                if (fullState.get(irqQuark).getStateValue().unboxInt() == cpu) {
-                                    ITmfStateInterval value = ss.querySingleState(event.getTime(), irqQuark);
-                                    if (!value.getStateValue().isNull()) {
-                                        int irq = Integer.parseInt(ss.getAttributeName(irqQuark));
-                                        retMap.put(Messages.ResourcesView_attributeIrqName, String.valueOf(irq));
-                                    }
+                                ITmfStateInterval value = fullState.get(irqQuark);
+                                if (!value.getStateValue().isNull()) {
+                                    String irq = ss.getAttributeName(irqQuark);
+                                    retMap.put(Messages.ResourcesView_attributeIrqName, irq);
                                     break;
                                 }
                             }
-                        } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
+                        } catch (TimeRangeException | StateValueTypeException e) {
                             Activator.getDefault().logError("Error in ResourcesPresentationProvider", e); //$NON-NLS-1$
                         } catch (StateSystemDisposedException e) {
                             /* Ignored */
@@ -215,16 +213,14 @@ public class ResourcesPresentationProvider extends TimeGraphPresentationProvider
                             List<Integer> softIrqQuarks = ss.getQuarks(Attributes.CPUS, Integer.toString(cpu), Attributes.SOFT_IRQS, "*"); //$NON-NLS-1$
 
                             for (int softIrqQuark : softIrqQuarks) {
-                                if (fullState.get(softIrqQuark).getStateValue().unboxInt() == cpu) {
-                                    ITmfStateInterval value = ss.querySingleState(event.getTime(), softIrqQuark);
-                                    if (!value.getStateValue().isNull()) {
-                                        int softIrq = Integer.parseInt(ss.getAttributeName(softIrqQuark));
-                                        retMap.put(Messages.ResourcesView_attributeSoftIrqName, String.valueOf(softIrq));
-                                    }
+                                ITmfStateInterval value = fullState.get(softIrqQuark);
+                                if (!value.getStateValue().isNull()) {
+                                    String softIrq = ss.getAttributeName(softIrqQuark);
+                                    retMap.put(Messages.ResourcesView_attributeSoftIrqName, softIrq);
                                     break;
                                 }
                             }
-                        } catch (AttributeNotFoundException | TimeRangeException | StateValueTypeException e) {
+                        } catch (TimeRangeException | StateValueTypeException e) {
                             Activator.getDefault().logError("Error in ResourcesPresentationProvider", e); //$NON-NLS-1$
                         } catch (StateSystemDisposedException e) {
                             /* Ignored */
This page took 0.027735 seconds and 5 git commands to generate.