Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 217768 Details for
Bug 371285
Session comparison between runs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Added PMSymbolMatch class
0001-Added-PMSymbolMatch.java-class.patch (text/plain), 4.66 KB, created by
Camilo Bernal
on 2012-06-22 18:32:53 EDT
(
hide
)
Description:
Added PMSymbolMatch class
Filename:
MIME Type:
Creator:
Camilo Bernal
Created:
2012-06-22 18:32:53 EDT
Size:
4.66 KB
patch
obsolete
>From 72f882c4520aa8c6e1315200ee1412f1eed569bb Mon Sep 17 00:00:00 2001 >From: Camilo Bernal <cabernal@redhat.com> >Date: Fri, 22 Jun 2012 16:50:15 -0400 >Subject: [PATCH] Added PMSymbolMatch.java class > >Added PMSymbolMatch.java, which holds two matching PMSymbols from separate >perf data files reports. Contains compare methods for the containing >PMSymbols and results. >--- > .../internal/perf/model/PMSymbolMatch.java | 159 ++++++++++++++++++++ > 1 files changed, 159 insertions(+), 0 deletions(-) > create mode 100644 perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/PMSymbolMatch.java > >diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/PMSymbolMatch.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/PMSymbolMatch.java >new file mode 100644 >index 0000000..0a5a62d >--- /dev/null >+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/PMSymbolMatch.java >@@ -0,0 +1,159 @@ >+/******************************************************************************* >+ * Copyright (c) 2012 Red Hat, Inc. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Camilo Bernal <cabernal@redhat.com> - Initial Implementation. >+ *******************************************************************************/ >+package org.eclipse.linuxtools.internal.perf.model; >+ >+public class PMSymbolMatch { >+ >+ // Name of matched dsos >+ private String name; >+ >+ // Path of matched dsos in the tree model >+ private String path; >+ >+ // Reference to newer dso >+ private PMSymbol fresh; >+ >+ // Reference to older dso >+ private PMSymbol stale; >+ >+ // Result >+ private String result; >+ >+ // Event >+ private String event; >+ >+ public PMSymbolMatch(PMSymbol fresh, PMSymbol stale) { >+ this.fresh = fresh; >+ this.stale = stale; >+ >+ if ((fresh != null && stale == null)) { >+ name = fresh.getName(); >+ result = "added"; >+ setEvent(true); >+ } else if ((fresh == null && stale != null)) { >+ name = stale.getName(); >+ result = "removed"; >+ setEvent(false); >+ } else if (((fresh != null) && (stale != null))) { >+ name = fresh.getName(); >+ this.result = String.valueOf(fresh.getPercent() >+ - stale.getPercent()); >+ setEvent(true); >+ } else { >+ name = ""; >+ path = ""; >+ event = ""; >+ result = ""; >+ } >+ } >+ >+ public void setEvent(boolean freshEvent) { >+ try { >+ if (freshEvent) { >+ event = fresh.getParent().getParent().getParent().getParent() >+ .getName(); >+ } else { >+ event = stale.getParent().getParent().getParent().getParent() >+ .getName(); >+ } >+ } catch (Exception e) { >+ e.printStackTrace(); >+ event = ""; >+ } >+ } >+ >+ public String getResult() { >+ try { >+ float res = Float.parseFloat(result); >+ if (res > 0) { >+ return "+" + result; >+ } else { >+ return result; >+ } >+ } catch (Exception e) { >+ return result; >+ } >+ } >+ >+ public String getName() { >+ return name; >+ } >+ >+ public String getPath() { >+ return path; >+ } >+ >+ public PMSymbol getFresh() { >+ return fresh; >+ } >+ >+ public PMSymbol getStale() { >+ return stale; >+ } >+ >+ public String getEvent() { >+ return event; >+ } >+ >+ /** >+ * Compare PMSymbols percentages against our pair >+ * >+ * @param p >+ * PMSymbols match >+ * @param compFresh >+ * true if fresh symbols are to be compared, false otherwise >+ * @return comparison of percentages >+ */ >+ public int compareSymbol(PMSymbolMatch p, boolean compFresh) { >+ PMSymbol thisSym; >+ PMSymbol otherSym; >+ int ret = 0; >+ if (compFresh) { >+ thisSym = fresh; >+ otherSym = p.getFresh(); >+ } else { >+ thisSym = stale; >+ otherSym = p.getStale(); >+ } >+ >+ if (thisSym == null && otherSym != null) { >+ ret = -1; >+ } else if (thisSym != null && otherSym == null) { >+ ret = 1; >+ } else if (thisSym == null && otherSym == null) { >+ ret = 0; >+ } else { >+ ret = (thisSym.getPercent() < otherSym.getPercent()) ? -1 : 1; >+ } >+ return ret; >+ } >+ >+ /** >+ * Compare result of given PMSymbols against our pair >+ * >+ * @param p >+ * PMSymbols match >+ * @return comparison of results >+ */ >+ public int compareResult(PMSymbolMatch p) { >+ int ret = 0; >+ String oldRes1 = result; >+ String oldRes2 = p.getResult(); >+ try { >+ float oldRes1f = Float.parseFloat(oldRes1); >+ float oldRes2f = Float.parseFloat(oldRes2); >+ ret = (oldRes1f < oldRes2f) ? -1 : 1; >+ } catch (NumberFormatException e) { >+ ret = oldRes1.compareTo(oldRes2); >+ } >+ return ret; >+ } >+} >\ No newline at end of file >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
jjohnstn
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 371285
: 217768 |
217769
|
217770
|
217771
|
217772
|
217773
|
217774
|
217775
|
217776
|
217779
|
218026
|
218056