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 217775 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 data comparison action
0001-Added-perf-data-comparison-action.patch (text/plain), 4.28 KB, created by
Camilo Bernal
on 2012-06-22 18:38:57 EDT
(
hide
)
Description:
Added data comparison action
Filename:
MIME Type:
Creator:
Camilo Bernal
Created:
2012-06-22 18:38:57 EDT
Size:
4.28 KB
patch
obsolete
>From c3ec19d7f664c6f053813aee3739e32f304def3e Mon Sep 17 00:00:00 2001 >From: Camilo Bernal <cabernal@redhat.com> >Date: Fri, 22 Jun 2012 18:14:07 -0400 >Subject: [PATCH] Added perf data comparison action. > >This action (PerfDiffAction.java) handles the selected data files, and uses >the PerfSymbolMatcher functionality to generate the PMSymbol matches from >the the selections. On inproper data file selections, the action displays >an error message dialog. >--- > .../internal/perf/ui/PerfDiffAction.java | 93 ++++++++++++++++++++ > 1 files changed, 93 insertions(+), 0 deletions(-) > create mode 100644 perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDiffAction.java > >diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDiffAction.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDiffAction.java >new file mode 100644 >index 0000000..2d27e72 >--- /dev/null >+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfDiffAction.java >@@ -0,0 +1,93 @@ >+/******************************************************************************* >+ * 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.ui; >+ >+import java.util.ArrayList; >+ >+import org.eclipse.core.resources.IFile; >+import org.eclipse.jface.action.Action; >+import org.eclipse.jface.dialogs.MessageDialog; >+import org.eclipse.linuxtools.internal.perf.model.PMSymbolMatch; >+import org.eclipse.linuxtools.internal.perf.model.PMSymbolMatcher; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.ui.IWorkbench; >+import org.eclipse.ui.IWorkbenchPage; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.PartInitException; >+import org.eclipse.ui.PlatformUI; >+ >+public class PerfDiffAction extends Action { >+ public PerfDiffAction() { >+ super("Session Comparison"); >+ } >+ >+ @Override >+ public void run() { >+ IWorkbench workbench = PlatformUI.getWorkbench(); >+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); >+ try { >+ IWorkbenchPage wbp = workbenchWindow.getActivePage(); >+ IWorkbench wb = PlatformUI.getWorkbench(); >+ IWorkbenchWindow win = wb.getActiveWorkbenchWindow(); >+ IWorkbenchPage page = win.getActivePage(); >+ >+ PerfDataCollectionView vp = (PerfDataCollectionView) page >+ .findView("org.eclipse.linuxtools.perf.ui.PerfSessionCompareView"); >+ >+ ArrayList<Object> selectedFiles = vp.getSelectedFiles(); >+ >+ if (selectedFiles.size() < 2) { >+ MessageDialog.openInformation(Display.getCurrent() >+ .getActiveShell(), "Warning", >+ "Please select two perf data files."); >+ vp.restart(); >+ } else { >+ IFile staleData; >+ IFile freshData; >+ >+ // Check if selections are proper files. >+ try { >+ staleData = (IFile) selectedFiles.get(0); >+ freshData = (IFile) selectedFiles.get(1); >+ } catch (ClassCastException e) { >+ e.printStackTrace(); >+ MessageDialog.openInformation(Display.getCurrent() >+ .getActiveShell(), "Error", >+ "Selections were not proper perf data files."); >+ vp.clearSelections(); >+ return; >+ } >+ >+ ArrayList<PMSymbolMatch> result = PMSymbolMatcher.buildResults( >+ staleData, freshData); >+ >+ // If result is null, selected files were not proper perf data >+ // files >+ if (result == null) { >+ MessageDialog.openInformation(Display.getCurrent() >+ .getActiveShell(), "Error", >+ "Selections were not proper perf data files."); >+ vp.clearSelections(); >+ } else { >+ >+ PerfDiffView diffView = (PerfDiffView) wbp >+ .showView("org.eclipse.linuxtools.perf.ui.PerfSessionDiffView"); >+ diffView.setResult(result); >+ diffView.refreshView(); >+ >+ wbp.showView("org.eclipse.linuxtools.perf.ui.PerfSessionDiffView"); >+ } >+ } >+ } catch (PartInitException e) { >+ e.printStackTrace(); >+ } >+ } >+} >\ 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