--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi-feature/feature.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi-feature/feature.xml Wed Jun 23 15:05:09 2010 +0300
@@ -2,14 +2,14 @@
<feature
id="com.nokia.carbide.cpp.pi"
label="%featureName"
- version="2.3.0.qualifier"
+ version="2.4.0.qualifier"
provider-name="Nokia"
plugin="com.nokia.carbide.cpp"
image="Carbide_Image.png">
<description>
- The Carbide.c++ Performance Investigator lets the user
-analyze performance data gathered on a handheld device by
+ The Carbide.c++ Performance Investigator lets the user
+analyze performance data gathered on a handheld device by
the Carbide.c++ Profiler application.
</description>
@@ -18,298 +18,298 @@
</copyright>
<license url="license.txt">
- COPYRIGHT LICENSE
-
- NOKIA CORPORATION END-USER SOFTWARE AGREEMENT FOR
- CARBIDE.C++ AND ASSOCIATED ON-DEVICE APPLICATIONS
-
-This Software Agreement ("Agreement") is between You (either an
-individual or an entity), the End User, and Nokia Corporation
-("Nokia"). The Agreement authorizes You to use the Software specified
-in Clause 1 below, which may be stored on a CD-ROM, sent to You by
-electronic mail, or downloaded from Nokia's Web pages or Servers or
-from other sources under the terms and conditions set forth below.
-This is an agreement on end-user rights and not an agreement for sale.
-Nokia continues to own the copy of the Software and the physical media
-contained in the sales package and any other copy that You are
-authorized to make pursuant to this Agreement.
-
-Read this Agreement carefully before installing, downloading, or using
-the Software. By clicking on the "I Accept" button while installing,
-downloading, and/or using the Software, You agree to the terms and
-conditions of this Agreement. If You do not agree to all of the terms
-and conditions of this Agreement, promptly click the "Decline" or
-"I Do Not Accept" button, cancel the installation or downloading, or
-destroy or return the Software and accompanying documentation to
-Nokia. YOU AGREE THAT YOUR USE OF THE SOFTWARE ACKNOWLEDGES THAT YOU
-HAVE READ THIS AGREEMENT, UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS
-TERMS AND CONDITIONS.
-
-
-1. SOFTWARE.
-
-As used in this Agreement, the term "Software" means, collectively:
-(i) the software product identified above (ii) all the contents of the
-disk(s), CD-ROM(s), electronic mail and its file attachments, or other
-media with which this Agreement is provided, including the object code
-form of the software delivered via a CD-ROM, electronic mail, or Web
-page (iii) digital images, stock photographs, clip art, or other
-artistic works ("Stock Files") (iv) related explanatory written
-materials and any other possible documentation related thereto
-("Documentation"); (v) fonts, and (vi) upgrades, modified versions,
-updates, additions, and copies of the Software (collectively
-"Updates"), if any, licensed to You by Nokia under this Agreement.
-
-
-2. END USER RIGHTS AND USE.
-
-Nokia grants to You non-exclusive, non-transferable end-user rights to
-install the Software on the local hard disk(s) or other permanent
-storage media of one computer and use the Software on a single
-computer or terminal at a time.
-
-You acknowledge that the use of the Software may require licenses to
-third party patents and that Nokia does not grant any licenses to such
-third party patents under this Agreement to You. Also, any and
-all standards related licenses with respect to Essential Patents (as
-defined below) are specifically excluded from the scope of this
-Agreement, and those licenses need to be acquired separately from
-Nokia or the respective right holders, as the case may be. "Essential
-Patent" means any patent claiming a feature necessarily and
-unavoidably required for compliance with industry standards (usually
-GSM, WCDMA or other similar mobile communications standard), to the
-limited extent only that infringement or use of such claims of a
-patent cannot be avoided in remaining compliant with industry standard
-either for technological reasons or for lack of commercially viable
-technical alternatives.
-
-No patent licenses to any patents of Nokia and/ or its Affiliates are
-granted under this Agreement.
-
-
-3. LIMITATIONS ON END USER RIGHTS.
-
-You may not copy, distribute, or make derivative works of the Software
-except as follows:
-
-(a) You may make one copy of the Software on magnetic media as an
-archival backup copy, provided Your archival backup copy is not
-installed or used on any computer. Any other copies You make of the
-Software are in violation of this Agreement.
-
-(b) You may not use, modify, translate, reproduce, or transfer the
-right to use the Software or copy the Software except as expressly
-provided in this Agreement.
-
-(c) You may not resell, sublicense, rent, lease, or lend the Software.
-
-(d) You may not reverse engineer, reverse compile, disassemble, or
-otherwise attempt to discover the source code of the Software (except
-to the extent that this restriction is expressly prohibited by law) or
-create derivative works based on the Software.
-
-(e) Unless stated otherwise in the Documentation, You shall not
-display, modify, reproduce, or distribute any of the Stock Files
-included with the Software. In the event that the Documentation allows
-You to display the Stock Files, You shall not distribute the Stock
-Files on a stand-alone basis, i.e., in circumstances in which the
-Stock Files constitute the primary value of the product being
-distributed. You should review the "Readme" files associated with the
-Stock Files that You use to ascertain what rights You have with
-respect to such materials. Stock Files may not be used in the
-production of libelous, defamatory, fraudulent, infringing, lewd,
-obscene, or pornographic material or in any otherwise illegal manner.
-You may not register or claim any rights in the Stock Files or
-derivative works thereof.
-
-(f) You agree that You shall only use the Software in a manner that
-complies with all applicable laws in the jurisdiction in which You use
-the Software, including, but not limited to, applicable restrictions
-concerning copyright and other intellectual property rights.
-
-
-4. INTELLECTUAL PROPERTY RIGHTS.
-
-The Software and all rights, without limitation including title and
-intellectual property rights therein, are owned by Nokia and/or its
-licensors and affiliates and are protected by international treaty
-provisions and all other applicable national laws of the country in
-which it is being used. The structure, organization, and code of the
-Software are the valuable trade secrets and confidential information
-of Nokia and/or its licensors and affiliates. You must not copy the
-Software, except as set forth in clause 3 (Limitations On End-User
-Rights). Any copies which You are permitted to make pursuant to this
-Agreement must contain the same copyright and other proprietary
-notices that appear on the Software.
-
-
-5. MULTIPLE ENVIRONMENT SOFTWARE / MULTIPLE LANGUAGE SOFTWARE /
-DUAL MEDIA SOFTWARE / MULTIPLE COPIES / UPDATES.
-
-If the Software supports multiple platforms or languages, if You
-receive the Software on multiple media, or if You otherwise receive
-multiple copies of the Software, the number of computers on which all
-versions of the Software are installed shall be one computer. You may
-not rent, lease, sublicense, lend, or transfer versions or copies of
-the Software You do not use. If the Software is an Update to a
-previous version of the Software, You must possess valid end-user
-rights to such a previous version in order to use the Update, and You
-may use the previous version for ninety (90) days after You receive
-the Update in order to assist You in the transition to the Update.
-After such time You no longer have a right to use the previous
-version, except for the sole purpose of enabling You to install the
-Update.
-
-
-6. COMMENCEMENT AND TERMINATION.
-
-This Agreement is effective from the first date You install the
-Software. You may terminate this Agreement at any time by permanently
-deleting, destroying, and returning, at Your own cost, the Software,
-all backup copies, and all related materials provided by Nokia. Your
-end-user rights automatically and immediately terminate without notice
-from Nokia if You fail to comply with any provision of this Agreement.
-In such an event, You must immediately delete, destroy, or return at
-Your own cost, the Software, all backup copies, and all related
-material to Nokia.
-
-
-7. YOU ACKNOWLEDGE THAT THE SOFTWARE IS PROVIDED "AS IS" WITHOUT
-WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, AND TO THE MAXIMUM EXTENT
-PERMITTED BY APPLICABLE LAW NEITHER NOKIA, ITS LICENSORS OR
-AFFILIATES, NOR THE COPYRIGHT HOLDERS MAKE ANY REPRESENTATIONS OR
-WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR
-THAT THE SOFTWARE WILL NOT INFRINGE ANY THIRD PARTY PATENTS,
-COPYRIGHTS, TRADEMARKS, OR OTHER RIGHTS. THERE IS NO WARRANTY BY NOKIA
-OR BY ANY OTHER PARTY THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE
-WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL
-BE UNINTERRUPTED OR ERROR-FREE. YOU ASSUME ALL RESPONSIBILITY AND RISK
-FOR THE SELECTION OF THE SOFTWARE TO ACHIEVE YOUR INTENDED RESULTS AND
-FOR THE INSTALLATION, USE, AND RESULTS OBTAINED FROM IT.
-
-
-8. NO OTHER OBLIGATIONS.
-
-This Agreement creates no obligations on the part of Nokia other than
-as specifically set forth herein.
-
-
-9. LIMITATION OF LIABILITY.
-
-TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL
-NOKIA, ITS EMPLOYEES OR LICENSORS OR AFFILIATES BE LIABLE FOR ANY LOST
-PROFITS, REVENUE, SALES, DATA, OR COSTS OF PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES, PROPERTY DAMAGE, PERSONAL INJURY, INTERRUPTION OF
-BUSINESS, LOSS OF BUSINESS INFORMATION, OR FOR ANY SPECIAL, DIRECT,
-INDIRECT, INCIDENTAL, ECONOMIC, COVER, PUNITIVE, SPECIAL, OR
-CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND WHETHER ARISING UNDER
-CONTRACT, TORT, NEGLIGENCE, OR OTHER THEORY OF LIABILITY ARISING OUT
-OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF NOKIA OR ITS
-LICENSORS OR AFFILIATES ARE ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES. BECAUSE SOME COUNTRIES/STATES/JURISDICTIONS DO NOT ALLOW THE
-EXCLUSION OF LIABILITY, BUT MAY ALLOW LIABILITY TO BE LIMITED, IN SUCH
-CASES, NOKIA, ITS EMPLOYEES OR LICENSORS OR AFFILIATES' LIABILITY
-SHALL BE LIMITED TO U.S. $50.
-
-Nothing contained in this Agreement shall prejudice the statutory
-rights of any party dealing as a consumer.
-
-Nothing contained in this Agreement limits Nokia's liability to You in
-the event of death or personal injury resulting from Nokia's
-negligence. Nokia is acting on behalf of its employees and licensors
-or affiliates for the purpose of disclaiming, excluding, and/or
-restricting obligations, warranties, and liability as provided in this
-clause 9, but in no other respects and for no other purpose.
-
-
-10. TECHNICAL SUPPORT.
-
-Nokia has no obligation to furnish You with technical support unless
-separately agreed in writing between You and Nokia.
-
-
-
-11. EXPORT CONTROL.
-
-The Software, including technical data, includes cryptographic
-software subject to export controls under the U.S. Export
-Administration Regulations ("EAR") and may be subject to import or
-export controls in other countries. The EAR prohibits the use of the
-Software and technical data by a Government End User, as defined
-hereafter, without a license from the U.S. government. A Government
-End User is defined in Part 772 of the EAR as "any foreign central,
-regional, or local government department, agency, or other entity
-performing governmental functions; including governmental research
-institutions, governmental corporations, or their separate business
-units (as defined in part 772 of the EAR) which are engaged in the
-manufacture or distribution of items or services controlled on the
-Wassenaar Munitions List, and international governmental
-organizations. This term does not include: utilities
-(telecommunications companies and Internet service providers; banks
-and financial institutions; transportation; broadcast or
-entertainment; educational organizations; civil health and medical
-organizations; retail or wholesale firms; and manufacturing or
-industrial entities not engaged in the manufacture or distribution of
-items or services controlled on the Wassenaar Munitions List.)" You
-agree to strictly comply with all applicable import and export
-regulations and acknowledge that You have the responsibility to obtain
-licenses to export, re-export, transfer, or import the Software. You
-further represent that You are not a Government End User as defined
-above, and You will not transfer the Software to any Government End
-User without a license.
-
-
-12. NOTICES.
-
-All notices and return of the Software and Documentation should be
-delivered to:
-
-NOKIA CORPORATION
-P.O. Box 100
-FIN-00045 NOKIA GROUP
-FINLAND
-
-
-13. APPLICABLE LAW AND GENERAL PROVISIONS.
-
-This Agreement is governed by the laws of Finland. All disputes
-arising from or relating to this Agreement shall be settled by a
-single arbitrator appointed by the Central Chamber of Commerce of
-Finland. The arbitration procedure shall take place in Helsinki,
-Finland in the English language. If any part of this Agreement is
-found void and unenforceable, it will not affect the validity of the
-balance of the Agreement, which shall remain valid and enforceable
-according to its terms. This Agreement may only be modified in writing
-signed by an authorized officer of Nokia.
-
-This is the entire agreement between Nokia and You relating to the
-Software, and it supersedes any prior representations, discussions,
-undertakings, end-user agreements, communications, or advertising
-relating to the Software.
-
-PLEASE SUBMIT ANY ACCOMPANYING REGISTRATION FORMS TO RECEIVE
-REGISTRATION BENEFITS WHERE APPLICABLE.
-
-
-14. COPYRIGHT NOTICES
-
-This product includes certain open source or other software
-originating from third parties that may be subject to the GNU
-General Public License (GPL) and different and/oradditional
-copyright licenses, disclaimers and notices. The exact terms
-of GPL and some other licenses, disclaimers and notices are
-reproduced in the materials provided with this product and are
-also available at http://tools.ext.nokia.com/oss/ . Please refer
-to the exact terms of the GPL regarding your rights under said
-license. You may obtain a complete corresponding machine-readable
-copy of the source code of such software under GPL and some other
-open source licenses allowing source code distribution at
-http://tools.ext.nokia.com/oss/ . Alternatively, Nokia offers
-to provide such source code to you on CD-ROM for a charge covering
-the cost of performing such distribution, such as the cost of media,
-shipping and handling, upon written request to Nokia at 701 Brazos St.,
-Suite 1000, Austin, TX 78701. This offer is valid for a period of
+ COPYRIGHT LICENSE
+
+ NOKIA CORPORATION END-USER SOFTWARE AGREEMENT FOR
+ CARBIDE.C++ AND ASSOCIATED ON-DEVICE APPLICATIONS
+
+This Software Agreement ("Agreement") is between You (either an
+individual or an entity), the End User, and Nokia Corporation
+("Nokia"). The Agreement authorizes You to use the Software specified
+in Clause 1 below, which may be stored on a CD-ROM, sent to You by
+electronic mail, or downloaded from Nokia's Web pages or Servers or
+from other sources under the terms and conditions set forth below.
+This is an agreement on end-user rights and not an agreement for sale.
+Nokia continues to own the copy of the Software and the physical media
+contained in the sales package and any other copy that You are
+authorized to make pursuant to this Agreement.
+
+Read this Agreement carefully before installing, downloading, or using
+the Software. By clicking on the "I Accept" button while installing,
+downloading, and/or using the Software, You agree to the terms and
+conditions of this Agreement. If You do not agree to all of the terms
+and conditions of this Agreement, promptly click the "Decline" or
+"I Do Not Accept" button, cancel the installation or downloading, or
+destroy or return the Software and accompanying documentation to
+Nokia. YOU AGREE THAT YOUR USE OF THE SOFTWARE ACKNOWLEDGES THAT YOU
+HAVE READ THIS AGREEMENT, UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS
+TERMS AND CONDITIONS.
+
+
+1. SOFTWARE.
+
+As used in this Agreement, the term "Software" means, collectively:
+(i) the software product identified above (ii) all the contents of the
+disk(s), CD-ROM(s), electronic mail and its file attachments, or other
+media with which this Agreement is provided, including the object code
+form of the software delivered via a CD-ROM, electronic mail, or Web
+page (iii) digital images, stock photographs, clip art, or other
+artistic works ("Stock Files") (iv) related explanatory written
+materials and any other possible documentation related thereto
+("Documentation"); (v) fonts, and (vi) upgrades, modified versions,
+updates, additions, and copies of the Software (collectively
+"Updates"), if any, licensed to You by Nokia under this Agreement.
+
+
+2. END USER RIGHTS AND USE.
+
+Nokia grants to You non-exclusive, non-transferable end-user rights to
+install the Software on the local hard disk(s) or other permanent
+storage media of one computer and use the Software on a single
+computer or terminal at a time.
+
+You acknowledge that the use of the Software may require licenses to
+third party patents and that Nokia does not grant any licenses to such
+third party patents under this Agreement to You. Also, any and
+all standards related licenses with respect to Essential Patents (as
+defined below) are specifically excluded from the scope of this
+Agreement, and those licenses need to be acquired separately from
+Nokia or the respective right holders, as the case may be. "Essential
+Patent" means any patent claiming a feature necessarily and
+unavoidably required for compliance with industry standards (usually
+GSM, WCDMA or other similar mobile communications standard), to the
+limited extent only that infringement or use of such claims of a
+patent cannot be avoided in remaining compliant with industry standard
+either for technological reasons or for lack of commercially viable
+technical alternatives.
+
+No patent licenses to any patents of Nokia and/ or its Affiliates are
+granted under this Agreement.
+
+
+3. LIMITATIONS ON END USER RIGHTS.
+
+You may not copy, distribute, or make derivative works of the Software
+except as follows:
+
+(a) You may make one copy of the Software on magnetic media as an
+archival backup copy, provided Your archival backup copy is not
+installed or used on any computer. Any other copies You make of the
+Software are in violation of this Agreement.
+
+(b) You may not use, modify, translate, reproduce, or transfer the
+right to use the Software or copy the Software except as expressly
+provided in this Agreement.
+
+(c) You may not resell, sublicense, rent, lease, or lend the Software.
+
+(d) You may not reverse engineer, reverse compile, disassemble, or
+otherwise attempt to discover the source code of the Software (except
+to the extent that this restriction is expressly prohibited by law) or
+create derivative works based on the Software.
+
+(e) Unless stated otherwise in the Documentation, You shall not
+display, modify, reproduce, or distribute any of the Stock Files
+included with the Software. In the event that the Documentation allows
+You to display the Stock Files, You shall not distribute the Stock
+Files on a stand-alone basis, i.e., in circumstances in which the
+Stock Files constitute the primary value of the product being
+distributed. You should review the "Readme" files associated with the
+Stock Files that You use to ascertain what rights You have with
+respect to such materials. Stock Files may not be used in the
+production of libelous, defamatory, fraudulent, infringing, lewd,
+obscene, or pornographic material or in any otherwise illegal manner.
+You may not register or claim any rights in the Stock Files or
+derivative works thereof.
+
+(f) You agree that You shall only use the Software in a manner that
+complies with all applicable laws in the jurisdiction in which You use
+the Software, including, but not limited to, applicable restrictions
+concerning copyright and other intellectual property rights.
+
+
+4. INTELLECTUAL PROPERTY RIGHTS.
+
+The Software and all rights, without limitation including title and
+intellectual property rights therein, are owned by Nokia and/or its
+licensors and affiliates and are protected by international treaty
+provisions and all other applicable national laws of the country in
+which it is being used. The structure, organization, and code of the
+Software are the valuable trade secrets and confidential information
+of Nokia and/or its licensors and affiliates. You must not copy the
+Software, except as set forth in clause 3 (Limitations On End-User
+Rights). Any copies which You are permitted to make pursuant to this
+Agreement must contain the same copyright and other proprietary
+notices that appear on the Software.
+
+
+5. MULTIPLE ENVIRONMENT SOFTWARE / MULTIPLE LANGUAGE SOFTWARE /
+DUAL MEDIA SOFTWARE / MULTIPLE COPIES / UPDATES.
+
+If the Software supports multiple platforms or languages, if You
+receive the Software on multiple media, or if You otherwise receive
+multiple copies of the Software, the number of computers on which all
+versions of the Software are installed shall be one computer. You may
+not rent, lease, sublicense, lend, or transfer versions or copies of
+the Software You do not use. If the Software is an Update to a
+previous version of the Software, You must possess valid end-user
+rights to such a previous version in order to use the Update, and You
+may use the previous version for ninety (90) days after You receive
+the Update in order to assist You in the transition to the Update.
+After such time You no longer have a right to use the previous
+version, except for the sole purpose of enabling You to install the
+Update.
+
+
+6. COMMENCEMENT AND TERMINATION.
+
+This Agreement is effective from the first date You install the
+Software. You may terminate this Agreement at any time by permanently
+deleting, destroying, and returning, at Your own cost, the Software,
+all backup copies, and all related materials provided by Nokia. Your
+end-user rights automatically and immediately terminate without notice
+from Nokia if You fail to comply with any provision of this Agreement.
+In such an event, You must immediately delete, destroy, or return at
+Your own cost, the Software, all backup copies, and all related
+material to Nokia.
+
+
+7. YOU ACKNOWLEDGE THAT THE SOFTWARE IS PROVIDED "AS IS" WITHOUT
+WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, AND TO THE MAXIMUM EXTENT
+PERMITTED BY APPLICABLE LAW NEITHER NOKIA, ITS LICENSORS OR
+AFFILIATES, NOR THE COPYRIGHT HOLDERS MAKE ANY REPRESENTATIONS OR
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR
+THAT THE SOFTWARE WILL NOT INFRINGE ANY THIRD PARTY PATENTS,
+COPYRIGHTS, TRADEMARKS, OR OTHER RIGHTS. THERE IS NO WARRANTY BY NOKIA
+OR BY ANY OTHER PARTY THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE
+WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL
+BE UNINTERRUPTED OR ERROR-FREE. YOU ASSUME ALL RESPONSIBILITY AND RISK
+FOR THE SELECTION OF THE SOFTWARE TO ACHIEVE YOUR INTENDED RESULTS AND
+FOR THE INSTALLATION, USE, AND RESULTS OBTAINED FROM IT.
+
+
+8. NO OTHER OBLIGATIONS.
+
+This Agreement creates no obligations on the part of Nokia other than
+as specifically set forth herein.
+
+
+9. LIMITATION OF LIABILITY.
+
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL
+NOKIA, ITS EMPLOYEES OR LICENSORS OR AFFILIATES BE LIABLE FOR ANY LOST
+PROFITS, REVENUE, SALES, DATA, OR COSTS OF PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES, PROPERTY DAMAGE, PERSONAL INJURY, INTERRUPTION OF
+BUSINESS, LOSS OF BUSINESS INFORMATION, OR FOR ANY SPECIAL, DIRECT,
+INDIRECT, INCIDENTAL, ECONOMIC, COVER, PUNITIVE, SPECIAL, OR
+CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND WHETHER ARISING UNDER
+CONTRACT, TORT, NEGLIGENCE, OR OTHER THEORY OF LIABILITY ARISING OUT
+OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF NOKIA OR ITS
+LICENSORS OR AFFILIATES ARE ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES. BECAUSE SOME COUNTRIES/STATES/JURISDICTIONS DO NOT ALLOW THE
+EXCLUSION OF LIABILITY, BUT MAY ALLOW LIABILITY TO BE LIMITED, IN SUCH
+CASES, NOKIA, ITS EMPLOYEES OR LICENSORS OR AFFILIATES' LIABILITY
+SHALL BE LIMITED TO U.S. $50.
+
+Nothing contained in this Agreement shall prejudice the statutory
+rights of any party dealing as a consumer.
+
+Nothing contained in this Agreement limits Nokia's liability to You in
+the event of death or personal injury resulting from Nokia's
+negligence. Nokia is acting on behalf of its employees and licensors
+or affiliates for the purpose of disclaiming, excluding, and/or
+restricting obligations, warranties, and liability as provided in this
+clause 9, but in no other respects and for no other purpose.
+
+
+10. TECHNICAL SUPPORT.
+
+Nokia has no obligation to furnish You with technical support unless
+separately agreed in writing between You and Nokia.
+
+
+
+11. EXPORT CONTROL.
+
+The Software, including technical data, includes cryptographic
+software subject to export controls under the U.S. Export
+Administration Regulations ("EAR") and may be subject to import or
+export controls in other countries. The EAR prohibits the use of the
+Software and technical data by a Government End User, as defined
+hereafter, without a license from the U.S. government. A Government
+End User is defined in Part 772 of the EAR as "any foreign central,
+regional, or local government department, agency, or other entity
+performing governmental functions; including governmental research
+institutions, governmental corporations, or their separate business
+units (as defined in part 772 of the EAR) which are engaged in the
+manufacture or distribution of items or services controlled on the
+Wassenaar Munitions List, and international governmental
+organizations. This term does not include: utilities
+(telecommunications companies and Internet service providers; banks
+and financial institutions; transportation; broadcast or
+entertainment; educational organizations; civil health and medical
+organizations; retail or wholesale firms; and manufacturing or
+industrial entities not engaged in the manufacture or distribution of
+items or services controlled on the Wassenaar Munitions List.)" You
+agree to strictly comply with all applicable import and export
+regulations and acknowledge that You have the responsibility to obtain
+licenses to export, re-export, transfer, or import the Software. You
+further represent that You are not a Government End User as defined
+above, and You will not transfer the Software to any Government End
+User without a license.
+
+
+12. NOTICES.
+
+All notices and return of the Software and Documentation should be
+delivered to:
+
+NOKIA CORPORATION
+P.O. Box 100
+FIN-00045 NOKIA GROUP
+FINLAND
+
+
+13. APPLICABLE LAW AND GENERAL PROVISIONS.
+
+This Agreement is governed by the laws of Finland. All disputes
+arising from or relating to this Agreement shall be settled by a
+single arbitrator appointed by the Central Chamber of Commerce of
+Finland. The arbitration procedure shall take place in Helsinki,
+Finland in the English language. If any part of this Agreement is
+found void and unenforceable, it will not affect the validity of the
+balance of the Agreement, which shall remain valid and enforceable
+according to its terms. This Agreement may only be modified in writing
+signed by an authorized officer of Nokia.
+
+This is the entire agreement between Nokia and You relating to the
+Software, and it supersedes any prior representations, discussions,
+undertakings, end-user agreements, communications, or advertising
+relating to the Software.
+
+PLEASE SUBMIT ANY ACCOMPANYING REGISTRATION FORMS TO RECEIVE
+REGISTRATION BENEFITS WHERE APPLICABLE.
+
+
+14. COPYRIGHT NOTICES
+
+This product includes certain open source or other software
+originating from third parties that may be subject to the GNU
+General Public License (GPL) and different and/oradditional
+copyright licenses, disclaimers and notices. The exact terms
+of GPL and some other licenses, disclaimers and notices are
+reproduced in the materials provided with this product and are
+also available at http://tools.ext.nokia.com/oss/ . Please refer
+to the exact terms of the GPL regarding your rights under said
+license. You may obtain a complete corresponding machine-readable
+copy of the source code of such software under GPL and some other
+open source licenses allowing source code distribution at
+http://tools.ext.nokia.com/oss/ . Alternatively, Nokia offers
+to provide such source code to you on CD-ROM for a charge covering
+the cost of performing such distribution, such as the cost of media,
+shipping and handling, upon written request to Nokia at 701 Brazos St.,
+Suite 1000, Austin, TX 78701. This offer is valid for a period of
three (3) years from the date of the distribution of this product by Nokia.
</license>
@@ -408,6 +408,13 @@
install-size="0"
version="0.0.0"
unpack="false"/>
+
+ <plugin
+ id="com.nokia.carbide.cpp.pi.graphicsmemory"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
<plugin
id="com.nokia.carbide.cpp.pi.power"
@@ -485,5 +492,6 @@
install-size="0"
version="0.0.0"
unpack="false"/>
+
</feature>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Threads and Addresses
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.address;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.address.AddressPlugin
Bundle-Vendor: Nokia
Require-Bundle: org.eclipse.ui,
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/internal/pi/address/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/internal/pi/address/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
import org.eclipse.osgi.util.NLS;
-public class Messages extends NLS {
+public final class Messages extends NLS {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.address.messages"; //$NON-NLS-1$
public static String GppTraceGraphSMP_0;
public static String GppTraceGraphSMP_1;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/internal/pi/address/actions/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/internal/pi/address/actions/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.address.actions.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/AddrBinaryTable.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/AddrBinaryTable.java Wed Jun 23 15:05:09 2010 +0300
@@ -687,7 +687,7 @@
}
PIVisualSharedData shared = myGraph.getSharedDataInstance();
- shared.GPP_SelectedBinaryNames = nameList;
+ shared.gppSelectedBinaryNames = nameList;
if ( (totalSamples != 0)
|| (myGraph.getDrawMode() == Defines.BINARIES))
@@ -727,7 +727,7 @@
// this table's set of checkbox-selected rows has changed,
// so propagate that information
PIVisualSharedData shared = myGraph.getSharedDataInstance();
- shared.GPP_SelectedBinaryNames = nameList;
+ shared.gppSelectedBinaryNames = nameList;
selectionChangeNotify();
this.table.deselectAll();
@@ -1553,7 +1553,7 @@
}
PIVisualSharedData shared = myGraph.getSharedDataInstance();
- shared.GPP_SelectedBinaryNames = binaryNames;
+ shared.gppSelectedBinaryNames = binaryNames;
}
private class SharedCheckHandler implements ICheckStateListener
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/AddrFunctionTable.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/AddrFunctionTable.java Wed Jun 23 15:05:09 2010 +0300
@@ -717,7 +717,7 @@
}
PIVisualSharedData shared = myGraph.getSharedDataInstance();
- shared.GPP_SelectedFunctionNames = nameList;
+ shared.gppSelectedFunctionNames = nameList;
if ( (totalSamples != 0)
|| (myGraph.getDrawMode() == Defines.FUNCTIONS))
@@ -757,7 +757,7 @@
// this table's set of checkbox-selected rows has changed,
// so propagate that information
PIVisualSharedData shared = myGraph.getSharedDataInstance();
- shared.GPP_SelectedFunctionNames = nameList;
+ shared.gppSelectedFunctionNames = nameList;
selectionChangeNotify();
this.table.deselectAll();
@@ -1483,7 +1483,7 @@
}
PIVisualSharedData shared = myGraph.getSharedDataInstance();
- shared.GPP_SelectedFunctionNames = functionNames;
+ shared.gppSelectedFunctionNames = functionNames;
}
private class SharedCheckHandler implements ICheckStateListener
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/AddrThreadTable.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/AddrThreadTable.java Wed Jun 23 15:05:09 2010 +0300
@@ -61,8 +61,8 @@
import com.nokia.carbide.cpp.internal.pi.address.GppModelAdapter;
import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
-import com.nokia.carbide.cpp.internal.pi.analyser.ProfileVisualiser;
import com.nokia.carbide.cpp.internal.pi.interfaces.ISaveSamples;
+import com.nokia.carbide.cpp.internal.pi.model.ICPUScale;
import com.nokia.carbide.cpp.internal.pi.model.ProfiledGeneric;
import com.nokia.carbide.cpp.internal.pi.model.ProfiledThread;
import com.nokia.carbide.cpp.internal.pi.model.ProfiledThreshold;
@@ -406,6 +406,30 @@
case COLUMN_ID_PERCENT_LOAD:
{
// Percent load string
+ Object object = profiledItem.getAdapter(ICPUScale.class);
+ if(object != null && profiledItem.isScaledCpu()){
+ String avgLoad = profiledItem.getAverageLoadValueString(graphIndex);
+ if (avgLoad != null && avgLoad.length() > 0) {
+ if(avgLoad.indexOf(',') != -1){ //$NON-NLS-1$
+ avgLoad = avgLoad.replace(',', '.');
+ }
+ float value = Float.valueOf(avgLoad);
+ if (value > 0.0) {
+ ICPUScale cpuScale = (ICPUScale) object;
+ value = value / 100;
+ int startTime = (int) (PIPageEditor
+ .currentPageEditor().getStartTime() * 1000);
+ int endTime = (int) (PIPageEditor
+ .currentPageEditor().getEndTime() * 1000);
+ value = value
+ * cpuScale.calculateScale(startTime,
+ endTime) * 100;
+ DecimalFormat decimalFormat = new DecimalFormat(
+ "#0.00"); //$NON-NLS-1$
+ return decimalFormat.format(value);
+ }
+ }
+ }
return profiledItem.getAverageLoadValueString(graphIndex);
}
case COLUMN_ID_THREAD:
@@ -682,7 +706,7 @@
}
PIVisualSharedData shared = myGraph.getSharedDataInstance();
- shared.GPP_SelectedThreadNames = nameList;
+ shared.gppSelectedThreadNames = nameList;
if ( (totalSamples != 0)
|| (myGraph.getDrawMode() == Defines.THREADS))
@@ -722,7 +746,7 @@
// this table's set of checkbox-selected rows has changed,
// so propagate that information
PIVisualSharedData shared = myGraph.getSharedDataInstance();
- shared.GPP_SelectedThreadNames = nameList;
+ shared.gppSelectedThreadNames = nameList;
selectionChangeNotify();
this.table.deselectAll();
@@ -1435,7 +1459,7 @@
}
PIVisualSharedData shared = myGraph.getSharedDataInstance();
- shared.GPP_SelectedThreadNames = threadNames;
+ shared.gppSelectedThreadNames = threadNames;
}
private class SharedCheckHandler implements ICheckStateListener
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/AddressPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/AddressPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -94,6 +94,7 @@
public static final String ACTION_COMBINED_CPU_VIEW = "combined_cpu_view";//$NON-NLS-1$
public static final String ACTION_SEPARATE_CPU_VIEW = "separate_cpu_view";//$NON-NLS-1$
public static final int[] TRACE_IDS_SMP = new int[]{1, 21, 41, 62};
+ public static final String PLUGIN_ID = "com.nokia.carbide.cpp.pi.address";
// private static HashMap<Integer,Long> uidToAddrThreadPeriod = new HashMap<Integer,Long>();
@@ -141,28 +142,28 @@
*/
public Class getReplacedClass(String className)
{
- if ( className.indexOf("com.nokia.carbide.cpp.pi.address.GppTrace") != -1 //$NON-NLS-1$
+ if ( className.indexOf(PLUGIN_ID+".GppTrace") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.model.GppTrace") != -1 //$NON-NLS-1$
|| className.indexOf("com.nokia.carbide.pi.address.GppTrace") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.gppTracePlugin.GppTrace") != -1) //$NON-NLS-1$
{
return GppTrace.class;
}
- else if ( className.indexOf("com.nokia.carbide.cpp.pi.address.GppSample") != -1 //$NON-NLS-1$
+ else if ( className.indexOf(PLUGIN_ID+".GppSample") != -1 //$NON-NLS-1$
|| className.indexOf("com.nokia.carbide.pi.address.GppSample") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.model.GppSample") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.gppTracePlugin.GppSample") != -1) //$NON-NLS-1$
{
return GppSample.class;
}
- else if ( className.indexOf("com.nokia.carbide.cpp.pi.address.GppThread") != -1 //$NON-NLS-1$
+ else if ( className.indexOf(PLUGIN_ID+".GppThread") != -1 //$NON-NLS-1$
|| className.indexOf("com.nokia.carbide.pi.address.GppThread") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.model.GppThread") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.gppTracePlugin.GppThread") != -1) //$NON-NLS-1$
{
return GppThread.class;
}
- else if ( className.indexOf("com.nokia.carbide.cpp.pi.address.GppProcess") != -1 //$NON-NLS-1$
+ else if ( className.indexOf(PLUGIN_ID+".GppProcess") != -1 //$NON-NLS-1$
|| className.indexOf("com.nokia.carbide.pi.address.GppProcess") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.model.GppProcess") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.gppTracePlugin.GppProcess") != -1) //$NON-NLS-1$
@@ -182,7 +183,7 @@
GppTrace trace = (GppTrace)genericTrace;
- NpiInstanceRepository.getInstance().activeUidAddTrace("com.nokia.carbide.cpp.pi.address", trace); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidAddTrace(PLUGIN_ID, trace); //$NON-NLS-1$
// initialize the address/thread base sampling rate
int samplingInterval = 1;
@@ -191,7 +192,7 @@
samplingInterval = (int) (((GppSample) trace.samples.get(1)).sampleSynchTime - ((GppSample) trace.samples.get(0)).sampleSynchTime);
}
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.samplingInterval", Integer.valueOf(samplingInterval)); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".samplingInterval", Integer.valueOf(samplingInterval)); //$NON-NLS-1$
// make sure that the sorted samples array exists
if (trace.getSortedGppSamples() == null)
@@ -205,12 +206,12 @@
public GppTrace getTrace()
{
- return (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ return (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
}
public IGppTraceGraph getTraceGraph(int graphIndex)
{
- GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
if (trace != null) {
int uid = NpiInstanceRepository.getInstance().activeUid();
@@ -221,12 +222,12 @@
public GenericTrace getTrace(int graphIndex)
{
- return (GenericTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ return (GenericTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
}
public Integer getLastSample(int graphIndex)
{
- GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
if (trace == null)
return null;
@@ -257,7 +258,7 @@
&& (currentPage != PIPageEditor.FUNCTIONS_PAGE))
return;
- GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
if (eventString.equals("fillSelected")) //$NON-NLS-1$
{
@@ -266,7 +267,7 @@
trace.getTraceGraph(i).piEventReceived(be);
}
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.fillAll", Boolean.FALSE); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".fillAll", Boolean.FALSE); //$NON-NLS-1$
}
else if (eventString.equals("fillAll")) //$NON-NLS-1$
{
@@ -275,7 +276,7 @@
trace.getTraceGraph(i).piEventReceived(be);
}
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.fillAll", Boolean.TRUE); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".fillAll", Boolean.TRUE); //$NON-NLS-1$
}
else if (eventString.equals("fillNone")) //$NON-NLS-1$
{
@@ -284,7 +285,7 @@
trace.getTraceGraph(i).piEventReceived(be);
}
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.fillAll", Boolean.FALSE); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".fillAll", Boolean.FALSE); //$NON-NLS-1$
}
else if (eventString.equals("setBarOn")) //$NON-NLS-1$
{
@@ -293,7 +294,7 @@
trace.getTraceGraph(i).piEventReceived(be);
}
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.bar", Boolean.TRUE); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".bar", Boolean.TRUE); //$NON-NLS-1$
}
else if (eventString.equals("setBarOff")) //$NON-NLS-1$
{
@@ -302,7 +303,7 @@
trace.getTraceGraph(i).piEventReceived(be);
}
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.bar", Boolean.FALSE); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".bar", Boolean.FALSE); //$NON-NLS-1$
}
else if (eventString.equals("resetToCurrentMode")) //$NON-NLS-1$
{
@@ -397,7 +398,7 @@
&& (currentPage != PIPageEditor.FUNCTIONS_PAGE))
return null;
- GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
Hashtable<Integer,Object> summary = new Hashtable<Integer,Object>();
Enumeration<ProfiledGeneric> e = trace.getSortedThreadsElements();
@@ -450,7 +451,7 @@
threadName = (String)((Vector<Object>)tmpTable.get(key)).elementAt(0);
}
- GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
Vector<GenericSample> samples = trace.getSamplesInsideTimePeriod((long)startTime, (long)endTime);
Hashtable<String,Integer> functionLoad = new Hashtable<String,Integer>();
@@ -653,13 +654,13 @@
Boolean bar = SessionPreferences.getInstance().getBarMode(); // default value to session preference
Object obj;
- obj = NpiInstanceRepository.getInstance().activeUidGetPersistState("com.nokia.carbide.cpp.pi.address.bar"); //$NON-NLS-1$
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(PLUGIN_ID+".bar"); //$NON-NLS-1$
if ((obj != null) && (obj instanceof Boolean))
// retrieve the current value
bar = (Boolean)obj;
else
// set the initial value
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.bar", bar); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".bar", bar); //$NON-NLS-1$
action.setChecked(bar);
action.setToolTipText("Show graph as vertical bars"); //$NON-NLS-1$
@@ -670,13 +671,13 @@
Boolean fillAll = SessionPreferences.getInstance().getFillAllEnabled(); // default value to session preference
// if there is a value associated with the current Analyser tab, then use it
- obj = NpiInstanceRepository.getInstance().activeUidGetPersistState("com.nokia.carbide.cpp.pi.address.fillAll"); //$NON-NLS-1$
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(PLUGIN_ID+".fillAll"); //$NON-NLS-1$
if ((obj != null) && (obj instanceof Boolean))
// retrieve the current value
fillAll = (Boolean)obj;
else
// set the initial value
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.address.fillAll", fillAll); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".fillAll", fillAll); //$NON-NLS-1$
action = new Action(Messages.getString("AddressPlugin.9"), IAction.AS_CHECK_BOX) { //$NON-NLS-1$
@Override
@@ -716,7 +717,7 @@
manager.add(new Separator());
- GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
if (trace != null && trace.getCPUCount() > 1){
//the following are SMP-related view options
@@ -763,7 +764,7 @@
if (plugin == null)
return null;
- GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
if (trace == null)
return null;
@@ -813,7 +814,7 @@
return;
try {
- final GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ final GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
int uid = NpiInstanceRepository.getInstance().activeUid();
trace.setAdditionalData((Vector<Object>)data);
@@ -853,14 +854,14 @@
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractPiPlugin.imageDescriptorFromPlugin("com.nokia.carbide.cpp.pi.address", path); //$NON-NLS-1$
+ return AbstractPiPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); //$NON-NLS-1$
}
/**
* number of graphs supplied by this plugin
*/
public int getGraphCount() {
- final GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ final GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
int graphCount = trace.getCPUCount() > 1 ? PAGE_COUNT + trace.getCPUCount() : PAGE_COUNT;
return graphCount;
}
@@ -1035,7 +1036,7 @@
*/
public void runOnPartOpened() {
//execute the initial action; since it affects the GIU, execute in UI thread
- GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.address"); //$NON-NLS-1$
+ GppTrace trace = (GppTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
if (trace != null && trace.getCPUCount() > 1){
boolean showCombinedCPUView = true;
@@ -1054,5 +1055,21 @@
}
}
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/GppTraceGraph.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/GppTraceGraph.java Wed Jun 23 15:05:09 2010 +0300
@@ -54,6 +54,7 @@
import com.nokia.carbide.cpp.internal.pi.address.GppTraceGraphSMP;
import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
import com.nokia.carbide.cpp.internal.pi.analyser.ProfileVisualiser;
+import com.nokia.carbide.cpp.internal.pi.model.ICPUScale;
import com.nokia.carbide.cpp.internal.pi.model.ProfiledBinary;
import com.nokia.carbide.cpp.internal.pi.model.ProfiledFunction;
import com.nokia.carbide.cpp.internal.pi.model.ProfiledGeneric;
@@ -66,6 +67,7 @@
import com.nokia.carbide.cpp.internal.pi.visual.GenericTraceGraph;
import com.nokia.carbide.cpp.internal.pi.visual.GraphComposite;
import com.nokia.carbide.cpp.internal.pi.visual.PIEvent;
+import com.nokia.carbide.cpp.pi.PiPlugin;
import com.nokia.carbide.cpp.pi.editors.PIPageEditor;
import com.nokia.carbide.cpp.pi.util.ColorPalette;
import com.nokia.carbide.cpp.pi.visual.IGenericTraceGraph;
@@ -2360,9 +2362,39 @@
public void widgetSelected(SelectionEvent e) {
AddressPlugin.getDefault().receiveSelectionEvent(isSeparate ? AddressPlugin.ACTION_COMBINED_CPU_VIEW : AddressPlugin.ACTION_SEPARATE_CPU_VIEW);
}
- });
+ });
+
}
+ ProfiledThread profiledThread = (ProfiledThread)getProfiledThreads().firstElement();
+ if(profiledThread != null){
+ Object object = profiledThread.getAdapter(ICPUScale.class);
+ if(object != null){
+ ICPUScale cpuScale = (ICPUScale)object;
+ if(cpuScale.isCpuScaleSupported()){
+ boolean scaleCPU = profiledThread.isScaledCpu();
+ new MenuItem(menu, SWT.SEPARATOR);
+ MenuItem scaleCPUMenuItem = new MenuItem(menu, SWT.CHECK);
+ scaleCPUMenuItem.setText(Messages.getString("GppTraceGraph.scaleCPUClockSpeed")); //$NON-NLS-1$
+ final boolean scaleCPUFinal = scaleCPU;
+
+ scaleCPUMenuItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ NpiInstanceRepository
+ .getInstance()
+ .activeUidSetPersistState(
+ PiPlugin.ACTION_SCALE_CPU, !scaleCPUFinal); //$NON-NLS-1$
+
+ for (int i = 0; i < 3; i++) {
+ GppTraceGraph graph = (GppTraceGraph) ((GppTrace)getTrace()).getTraceGraph(i);
+ graph.action(IGppTraceGraph.ACTION_CHANGE_THRESHOLD_THREAD);
+ graph.updateSelectionArea(PIPageEditor.currentPageEditor().getStartTime(), PIPageEditor.currentPageEditor().getEndTime());
+ }
+ }
+ });
+ scaleCPUMenuItem.setSelection(scaleCPUFinal);
+ }
+ }
+ }
}
-
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/GppTraceParser.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/GppTraceParser.java Wed Jun 23 15:05:09 2010 +0300
@@ -232,8 +232,8 @@
{
try
{
- int separatorIndex = data.indexOf("#"); //$NON-NLS-1$
- this.traceVersion = data.substring(data.indexOf("_")+1,separatorIndex); //$NON-NLS-1$
+ int separatorIndex = data.indexOf('#'); //$NON-NLS-1$
+ this.traceVersion = data.substring(data.indexOf('_')+1,separatorIndex); //$NON-NLS-1$
}
catch (Exception e)
{
@@ -399,11 +399,11 @@
{
if (name.endsWith("]")) //$NON-NLS-1$
{
- String l = name.substring(name.lastIndexOf("[")+1,name.lastIndexOf("]")); //$NON-NLS-1$ //$NON-NLS-2$
+ String l = name.substring(name.lastIndexOf('[')+1,name.lastIndexOf(']')); //$NON-NLS-1$ //$NON-NLS-2$
Long threadAddress = Long.decode("0x"+l); //$NON-NLS-1$
// this.threadAddressToName.put(threadAddress,name);
this.threadAddressToName.put(threadAddress,p.name+"::"+name);
- name = name.substring(0,name.lastIndexOf("[")); //$NON-NLS-1$
+ name = name.substring(0,name.lastIndexOf('[')); //$NON-NLS-1$
}
}
catch (Exception e)
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.address.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/messages.properties Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.address/src/com/nokia/carbide/cpp/pi/address/messages.properties Wed Jun 23 15:05:09 2010 +0300
@@ -53,6 +53,7 @@
GppTraceGraph.unknownDrawMode=Internal Error: Unknown drawMode
GppTraceGraph.actionString=Action string:
GppTraceGraph.drawMode=Draw mode:
+GppTraceGraph.scaleCPUClockSpeed=Scale to CPU Clock Speed
GppTraceGraph.unknownOrExcludedThreads=unknown or excluded threads
GppTraceParser.3=Data:
GppTraceParser.5=\ profiler:
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Buttons
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.button;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.button.ButtonPlugin
Bundle-Vendor: Nokia
Bundle-Localization: plugin
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/icons/PI_Meter_16x16.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/icons/PI_Meter_20x20.png has changed
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/internal/pi/button/ui/BupProfileEditDialog.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/internal/pi/button/ui/BupProfileEditDialog.java Wed Jun 23 15:05:09 2010 +0300
@@ -40,11 +40,10 @@
import org.eclipse.ui.PlatformUI;
import com.nokia.carbide.cpp.pi.button.BupEventMapManager;
+import com.nokia.carbide.cpp.pi.button.ButtonPlugin;
import com.nokia.carbide.cpp.pi.button.ComNokiaCarbidePiButtonHelpIDs;
import com.nokia.carbide.cpp.pi.button.IBupEventMap;
import com.nokia.carbide.cpp.pi.button.IBupEventMapProfile;
-import com.nokia.carbide.cpp.ui.CarbideUIPlugin;
-import com.nokia.carbide.cpp.ui.ICarbideSharedImages;
public class BupProfileEditDialog extends TitleAreaDialog {
@@ -81,7 +80,7 @@
public Control createDialogArea(Composite parent) {
getShell().setText(Messages.getString("BupProfileEditDialog.editingProfile") + profileForThisEdit.getProfileId()); //$NON-NLS-1$
- setTitleImage(CarbideUIPlugin.getSharedImages().getImageDescriptor(ICarbideSharedImages.IMG_PI_METER_20_20).createImage());
+ setTitleImage(ButtonPlugin.getImageDescriptor("icons/PI_Meter_20x20.png").createImage()); //$NON-NLS-1$
setTitle(Messages.getString("BupProfileEditDialog.profile") + profileForThisEdit.getProfileId()); //$NON-NLS-1$
GridLayoutFactory layoutExpandBoth = GridLayoutFactory.fillDefaults();
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/internal/pi/button/ui/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/internal/pi/button/ui/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -21,7 +21,7 @@
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.button.ui.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/internal/pi/button/ui/ModifyCachedBupEventMap.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/internal/pi/button/ui/ModifyCachedBupEventMap.java Wed Jun 23 15:05:09 2010 +0300
@@ -165,12 +165,12 @@
* @see com.nokia.carbide.cpp.pi.button.IBupEventMap#toEmfModel()
*/
public ButtonEventProfileType toEmfModel() {
- ButtonEventProfileType profile = PIConfigFactory.eINSTANCE.createButtonEventProfileType();
+ ButtonEventProfileType profile = PIConfigFactory.E_INSTANCE.createButtonEventProfileType();
profile.setProfileId(getProfile().getProfileId());
EList<MappingType> mappingList = profile.getMapping();
for (Entry<Integer, TableEntry> entry : cachedMap.entrySet()) {
- MappingType mappingType = PIConfigFactory.eINSTANCE.createMappingType();
+ MappingType mappingType = PIConfigFactory.E_INSTANCE.createMappingType();
mappingType.setKeyCode(entry.getKey().longValue());
mappingType.setEnumString(entry.getValue().enumString);
mappingType.setLabel(entry.getValue().label);
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/internal/pi/button/ui/SwitchBupMapDialog.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/internal/pi/button/ui/SwitchBupMapDialog.java Wed Jun 23 15:05:09 2010 +0300
@@ -38,12 +38,11 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
+import com.nokia.carbide.cpp.pi.button.ButtonPlugin;
import com.nokia.carbide.cpp.pi.button.ComNokiaCarbidePiButtonHelpIDs;
import com.nokia.carbide.cpp.pi.button.IBupEventMapProfile;
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
-import com.nokia.carbide.cpp.ui.CarbideUIPlugin;
-import com.nokia.carbide.cpp.ui.ICarbideSharedImages;
public class SwitchBupMapDialog extends TitleAreaDialog {
@@ -68,7 +67,7 @@
composite = new Composite(parent, SWT.NONE);
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ComNokiaCarbidePiButtonHelpIDs.PI_KEY_MAP_SWITCH_DIALOG);
getShell().setText(Messages.getString("SwitchBupMapDialog.switchKeyPressProfile")); //$NON-NLS-1$
- setTitleImage(CarbideUIPlugin.getSharedImages().getImageDescriptor(ICarbideSharedImages.IMG_PI_METER_20_20).createImage());
+ setTitleImage(ButtonPlugin.getImageDescriptor("icons/PI_Meter_20x20.png").createImage()); //$NON-NLS-1$
setTitle(Messages.getString("SwitchBupMapDialog.remapMessage")); //$NON-NLS-1$
GridLayoutFactory layoutExpandBoth = GridLayoutFactory.fillDefaults();
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/pi/button/BupEventMapManager.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/pi/button/BupEventMapManager.java Wed Jun 23 15:05:09 2010 +0300
@@ -172,7 +172,7 @@
profile = buttonProfile;
EList<MappingType> mappingList = buttonProfileType.getMapping();
for (MappingType mapping : mappingList) {
- addMapping(new Long(mapping.getKeyCode()).intValue(), mapping.getEnumString(), mapping.getLabel());
+ addMapping(Long.valueOf(mapping.getKeyCode()).intValue(), mapping.getEnumString(), mapping.getLabel());
}
}
@@ -240,12 +240,12 @@
}
public ButtonEventProfileType toEmfModel() {
- ButtonEventProfileType profile = PIConfigFactory.eINSTANCE.createButtonEventProfileType();
+ ButtonEventProfileType profile = PIConfigFactory.E_INSTANCE.createButtonEventProfileType();
profile.setProfileId(getProfileName());
EList<MappingType> mappingList = profile.getMapping();
for (Entry<Integer, MapEntry> entry : keyCodeMap.entrySet()) {
- MappingType mappingType = PIConfigFactory.eINSTANCE.createMappingType();
+ MappingType mappingType = PIConfigFactory.E_INSTANCE.createMappingType();
mappingType.setKeyCode(entry.getKey().longValue());
mappingType.setEnumString(entry.getValue().enumString);
mappingType.setLabel(entry.getValue().label);
@@ -439,7 +439,7 @@
ButtonEventProfileListType workspace_settings = PIConfigXMLLoader.loadPiSettings(WORKSPACE_PREF_KEY_MAP_URI.toURL());
EList<ButtonEventProfileType> workspace_profileList = workspace_settings.getButtonEventProfile();
- ButtonEventProfileType buttonEventProfileType = PIConfigFactory.eINSTANCE.createButtonEventProfileType();
+ ButtonEventProfileType buttonEventProfileType = PIConfigFactory.E_INSTANCE.createButtonEventProfileType();
buttonEventProfileType.setProfileId(profileId);
buttonEventProfileType.getMapping().clear();
@@ -545,7 +545,7 @@
}
public void saveMap (URI uri, ArrayList<ButtonEventProfileType> mapList) {
- ButtonEventProfileListType profileList = PIConfigFactory.eINSTANCE.createButtonEventProfileListType();
+ ButtonEventProfileListType profileList = PIConfigFactory.E_INSTANCE.createButtonEventProfileListType();
profileList.setButtonEventProfileVersion(new BigDecimal("1.0")); //$NON-NLS-1$
profileList.getButtonEventProfile().addAll(mapList);
try {
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/pi/button/BupUpdater.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/pi/button/BupUpdater.java Wed Jun 23 15:05:09 2010 +0300
@@ -26,7 +26,7 @@
import com.nokia.carbide.cpp.internal.pi.test.PIAnalyser;
-public class BupUpdater {
+public final class BupUpdater {
static private BupUpdater instance = null;
private static TreeMap<String, Integer> OneOneHexToStringMap = new TreeMap<String, Integer>();
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/pi/button/ButtonPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/pi/button/ButtonPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -420,8 +420,8 @@
result.setSize(maxSize + 1);
result.setElementAt(profile.getProfileId(), BUP_MAP_PROFILE_ID);
result.setElementAt(profile.getSDK() != null ? profile.getSDK().getUniqueId() : "", BUP_MAP_SYMBIAN_SDK_ID); //$NON-NLS-1$
- result.setElementAt(new Boolean(profile.getURI().equals(BupEventMapManager.WORKSPACE_PREF_KEY_MAP_URI)), BUP_MAP_IS_WORSPACE);
- result.setElementAt(new Boolean(profile.getURI().equals(BupEventMapManager.DEFAULT_PROFILE_URI)), BUP_MAP_IS_BUILTIN);
+ result.setElementAt(Boolean.valueOf(profile.getURI().equals(BupEventMapManager.WORKSPACE_PREF_KEY_MAP_URI)), BUP_MAP_IS_WORSPACE);
+ result.setElementAt(Boolean.valueOf(profile.getURI().equals(BupEventMapManager.DEFAULT_PROFILE_URI)), BUP_MAP_IS_BUILTIN);
return result;
}
@@ -544,4 +544,20 @@
GeneralMessages.showWarningMessage(Messages.getString("ButtonPlugin.keyMapRemoved")); //$NON-NLS-1$
return BupEventMapManager.getInstance().getPrefSelectedProfile();
}
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/pi/button/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.button/src/com/nokia/carbide/cpp/pi/button/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -21,7 +21,7 @@
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.button.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.call/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.call/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Function Calls
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.call;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.call.CallPlugin
Bundle-Vendor: Nokia
Bundle-Localization: plugin
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.call/src/com/nokia/carbide/cpp/pi/call/CallPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.call/src/com/nokia/carbide/cpp/pi/call/CallPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -351,4 +351,20 @@
public ParsedTraceData parseTraceFiles(File[] files) throws Exception {
throw new UnsupportedOperationException();
}
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.call/src/com/nokia/carbide/cpp/pi/call/CallVisualiser.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.call/src/com/nokia/carbide/cpp/pi/call/CallVisualiser.java Wed Jun 23 15:05:09 2010 +0300
@@ -171,7 +171,7 @@
protected Action saveTableAction;
protected Action functionSaveFunctionAction;
- protected static int SAMPLES_AT_ONE_TIME = 1000;
+ protected final static int SAMPLES_AT_ONE_TIME = 1000;
private Job setTimeframeJob = null;
// class to pass sample data to the save wizard
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.call/src/com/nokia/carbide/cpp/pi/call/GfcTrace.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.call/src/com/nokia/carbide/cpp/pi/call/GfcTrace.java Wed Jun 23 15:05:09 2010 +0300
@@ -212,14 +212,14 @@
caller.functionName = gSam.getCallerFunctionItt().getFunctionName();
caller.startAdress = gSam.getCallerFunctionItt().getStartAddress();
caller.binaryName = gSam.getCallerFunctionItt().getFunctionBinary().getBinaryName();
- caller.symbolParsed = false;
+ caller.symbolParsed = Boolean.FALSE;
}
else
{
caller.functionName = gSam.getCallerFunctionSym().getFunctionName();
caller.startAdress = gSam.getCallerFunctionSym().getStartAddress();
caller.binaryName = gSam.getCallerFunctionSym().getFunctionBinary().getBinaryName();
- caller.symbolParsed = Boolean.valueOf(true);
+ caller.symbolParsed = Boolean.TRUE;
}
if ( (gSam.getCurrentFunctionSym() == null || gSam.getCurrentFunctionSym().getFunctionName().endsWith(Messages.getString("GfcTrace.functionNotFound"))) //$NON-NLS-1$
@@ -228,14 +228,14 @@
callee.functionName = gSam.getCurrentFunctionItt().getFunctionName();
callee.startAdress = gSam.getCurrentFunctionItt().getStartAddress();
callee.binaryName = gSam.getCurrentFunctionItt().getFunctionBinary().getBinaryName();
- callee.symbolParsed = Boolean.valueOf(false);
+ callee.symbolParsed = Boolean.FALSE;
}
else
{
callee.functionName = gSam.getCurrentFunctionSym().getFunctionName();
callee.startAdress = gSam.getCurrentFunctionSym().getStartAddress();
callee.binaryName = gSam.getCurrentFunctionSym().getFunctionBinary().getBinaryName();
- callee.symbolParsed = Boolean.valueOf(true);
+ callee.symbolParsed = Boolean.TRUE;
}
this.updateEntryLists(sample, programCounter, linkRegister, caller, callee);
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.call/src/com/nokia/carbide/cpp/pi/call/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.call/src/com/nokia/carbide/cpp/pi/call/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.call.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.core/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.core/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Core
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.core;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.core.PICorePlugin
Bundle-Vendor: Nokia
Bundle-Localization: plugin
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.core/src/com/nokia/carbide/cpp/pi/core/PIProjectNature.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.core/src/com/nokia/carbide/cpp/pi/core/PIProjectNature.java Wed Jun 23 15:05:09 2010 +0300
@@ -31,7 +31,7 @@
public static final String PI_NATURE_ID = PICorePlugin.PLUGIN_ID + ".pinature"; //$NON-NLS-1$
- private IProject fProject;
+ private transient IProject fProject;
public void configure() throws CoreException {
}
@@ -42,7 +42,7 @@
public PIProjectNature() {
}
- public PIProjectNature(IProject project) {
+ public PIProjectNature(final IProject project) {
setProject(project);
}
@@ -50,21 +50,21 @@
return fProject;
}
- public void setProject(IProject project) {
+ public void setProject(final IProject project) {
fProject = project;
}
- public static void addPINature(IProject project, IProgressMonitor mon) throws CoreException {
+ public static void addPINature(final IProject project, final IProgressMonitor mon) throws CoreException {
addNature(project, PI_NATURE_ID, mon);
}
- public static void removePINature(IProject project, IProgressMonitor mon) throws CoreException {
+ public static void removePINature(final IProject project, final IProgressMonitor mon) throws CoreException {
removeNature(project, PI_NATURE_ID, mon);
}
private static void addNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException {
- IProjectDescription description = project.getDescription();
- String[] prevNatures = description.getNatureIds();
+ final IProjectDescription description = project.getDescription();
+ final String[] prevNatures = description.getNatureIds();
for (String prevNature : prevNatures) {
if (natureId.equals(prevNature)) {
return;
@@ -78,9 +78,9 @@
}
private static void removeNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException {
- IProjectDescription description = project.getDescription();
- String[] prevNatures = description.getNatureIds();
- List<String> newNatures = new ArrayList<String>(Arrays.asList(prevNatures));
+ final IProjectDescription description = project.getDescription();
+ final String[] prevNatures = description.getNatureIds();
+ final List<String> newNatures = new ArrayList<String>(Arrays.asList(prevNatures));
newNatures.remove(natureId);
description.setNatureIds((String[]) newNatures.toArray(new String[newNatures.size()]));
project.setDescription(description, monitor);
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.core/src/com/nokia/carbide/cpp/pi/core/SessionPreferences.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.core/src/com/nokia/carbide/cpp/pi/core/SessionPreferences.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,7 +17,7 @@
package com.nokia.carbide.cpp.pi.core;
-public class SessionPreferences {
+public final class SessionPreferences {
private static SessionPreferences instance;
private static final int WINDOW_DEFAULT_HEIGHT = 778;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,5 +2,5 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Extensions - Performance Investigator Help Plug-in
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.doc.user;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Vendor: Nokia
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/about.html Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/about.html Wed Jun 23 15:05:09 2010 +0300
@@ -9,7 +9,7 @@
<body lang="”EN-US”">
<h2>About This Content</h2>
-<p>April 21, 2010</p>
+<p>June 20, 2010</p>
<h3>Copyright</h3>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/bugs_fixed.htm Wed Jun 23 14:49:59 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>PI Bugs Fixed</title>
- <link href="../book.css" rel="stylesheet" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <link href="../book.css" rel="stylesheet" type="text/css" />
- <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script>
-</head>
-<body bgcolor="#ffffff">
-<h2>Performance Investigator Bugs Fixed </h2>
-<p>This is a comprehensive list of bugs fixed by release: </p>
-<ul>
- <li><a href="#bugs210">Bugs Fixed in 2.1.0</a></li>
- <li><a href="#bugs200">Bugs Fixed in 2.0.0</a></li>
- <li><a href="\">Bugs Fixed in 1.3.1</a>, <a href="\">1.3.0</a>, <a href="\">1.2.2</a>, <a href="#bugs121">1.2.1</a></li>
-</ul>
-<h3><a name="bugs210" id="bugs2"></a>Bugs Fixed in v2.1.0</h3>
-<ul>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=8500">8500</a> - Fixed an issue that when importing symbols where certain symbols contained erroneous address data.</li>
-</ul>
-<h3><a name="bugs200" id="bugs"></a>Bugs Fixed in v2.0.0</h3>
-<ul>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=2332">2332</a> - Added ability to change the CPU address/thread sampling interval between 1ms and 10000ms (10 seconds). </li>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=4033">4033</a> - The Select Time Interval dialog has been improved to prevent choosing intervals that extend outside the range of profiled data. Choosing time intervals by using click-drag-release in graphs has been similarly improved. An interval partly outside the graph is converted to one that ends at the last CPU load sample time. </li>
-</ul>
-<h3><a name="bugs131" id="bugs131"></a>Bugs Fixed in v1.3.1</h3>
-<ul>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=2550">2550</a> - Made PI importing more robust to prevent attempts to load malformed or incorrectly labeled .DAT files.</li>
-</ul>
-<h3><a name="bugs130" id="bugs130"></a>Bugs Fixed in v1.3.0</h3>
-<ul>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=3664">3664</a> - Use the pointer to select time in any of the graph views (CPU load, power, memory) or enter the selection values in the Select Time Interval dialog</li>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=3933">3933</a> - Its now possible in PI to select all the rows in a table using Ctrl-A/Select All</li>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=4033">4033</a> - CPU Profiling Data selection has been improved to prevent assigning values that extend outside the range of profiled data</li>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=4458">4458</a> - Added support to Importer for ROFS symbols and multiple ROFS images</li>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=4488">4488</a> - PI will no longer issue a "Function not found" error message when the SYMBOL file function is the last function in the DLL</li>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=4785">4785</a> - The Average Power Mode graphics should be much more readable now</li>
- <li><a href="https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=5759">5759</a> - Updated the Carbide Profiler to work with the N93 </li>
-</ul>
-<h3><a name="bugs122" id="bugs122"></a>Bugs Fixed in v1.2.2</h3>
-<ul>
- <li><b>4197</b> - Fixed an issue that could cause the PI Function tab to hang when zooming to the entire selection</li>
- <li><b>4206</b> - Corrected a syntax reading error in OBY files that incorrectly resolved the ROFS path and prevented analysis of binaries and functions</li>
- <li><b>4333</b> - Contextual menus now correctly appear as inactive when tables in the Function Calls tab are blank</li>
- <li><b>4335</b> - Selecting an empty time period now correctly clears all tables in the Function Calls tab</li>
- <li><b>4336</b> - Closing an error dialog will no longer cause an exception after attempting to open a source file for the selected function</li>
-</ul>
-<h3><a name="bugs121" id="bugs121"></a>Bugs Fixed in v1.2.1</h3>
-<ul>
- <li><b>3942</b> - Changing a Button Event Mark value from numerical "5" to string "Five" in the Name box and adding a comment should no longer corrupt the NPI data file</li>
- <li><b>3946</b> - The Memory Statistics dialog now shows a value for the highest memory usage found in the given interval (see 4018) </li>
- <li><b>3951</b> - The Memory Usage Data view revised to show more meaningful thread/process names and documentation revised to clarify column contents </li>
- <li><b>3959</b> - Power usage documentation revised to clarify constraint of device timing when doing power measurements </li>
- <li><b>3979</b> - Analyzer updated to better handle data files with incorrectly structured address/thread traces </li>
- <li><b>4018</b> - Added the Memory Statistics dialog with max RAM usage information to the documentation (see 3946)</li>
-</ul>
-<p><br />
-</p>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-
-</body>
-</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/cheatsheets/getStarted_pi1_cs.xml Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cheatsheet title="Performance Investigator Setup for On-device Profiling">
+ <intro>
+ <description>
+ Follow these steps to create a Performance Investigator project and to analyze it.
+ To open a related help page,you can click the question mark icon at the end of the task title row.
+ </description>
+ </intro>
+
+ <item title="Install PI Profiler" href="/com.nokia.carbide.cpp.pi.doc.user/html/tasks/profiler/prof_installation.htm" skip="true" >
+ <description>
+ Transfer and install S60_3_1_PIProfiler_v2_x_x.sisx file to the target device.
+ </description>
+ </item>
+
+ <item title="Setup and Start Profiler" href="/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/prof_using.htm" skip="true" >
+ <description>
+ Setup Profiler on the target device and capture application data.
+ </description>
+ </item>
+
+ <item title="Transfer Profiler Data File to PC" href="/com.nokia.carbide.cpp.pi.doc.user/html/tasks/profiler/usb_connection.htm" skip="true" >
+ <description>
+ Transfer the profiler data file to the PC by USB, Bluetooth, or serial interface connection.
+ </description>
+ </item>
+
+ <item title="Import Profiler Data File" href="/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/an_load_trace_files.htm" skip="false" >
+ <description>
+ Use the Performance Investigator Import Wizard to import profiler data file into Carbide.c++ for analysis.
+Start the wizard in Carbide.c++ by selecting <b>Carbide</b> > <b>Performance investigator</b>.
+On the <b>Select Profiler Data Files</b> page, select to get profiler data <b>From File System</b>, and continue from there.
+Click the question mark icon to view the Help for detailed instructions.
+ </description>
+ </item>
+
+ <item title="Analyze Application Profile" href="/com.nokia.carbide.cpp.pi.doc.user/html/Getting_Started/example_project.htm" skip="false" >
+ <description>
+ Analyze the profiled application data within Pi Analyser Carbide.c++ extension.
+If you imported only one file, the data will open directly to the PI Analyser view. If you imported several files, they will be listed in the PI view and you can double click on an item to view and analyse it in PI Analyser.
+ </description>
+ </item>
+
+</cheatsheet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/cheatsheets/getStarted_pi2_cs.xml Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cheatsheet title="Performance Investigator Setup for Remote Profiling">
+
+<intro>
+<description>
+Follow these steps to enable and start remote profiling on a target device.
+To open a related help page for more specific information, click the question mark icon at the end of the task title row.
+</description>
+</intro>
+
+<item
+ dialog="true"
+ skip="false"
+ title="Install Nokia PC Suite on the PC.">
+<description>
+Install the latest <b>Nokia PC Suite</b> on your PC and launch Carbide.c++ IDE.
+</description>
+</item>
+
+
+
+<item
+ dialog="true"
+ skip="false"
+ title="Connect a USB cable.">
+<description>
+Connect a USB cable to the PC and then to the target device.
+</description>
+</item>
+<item
+ title="Start the Performance Investigator Import Wizard">
+ <description>
+ Start the Import Wizard in Carbide.c++ by selecting <b>Carbide > Performance Investigator</b>
+ </description>
+</item>
+<item
+ href="/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/collect_prof_data_remotely.htm#First"
+ title="Import data from device by tracing">
+ <description>
+ On the <b>Select Profiler Data Files</b> page, select to get profiler data <b>From Device via TraceViewer</b>.
+ </description>
+</item>
+
+
+
+<item title="Check connection settings" dialog="true" skip="false" href="/com.nokia.traceviewer.help/html/reference/preferencesconnection.htm">
+<description>
+Before you start tracing, check the connections settings. Select <b>Connection settings</b> to open the TraceViewer Connections Setting dialog.
+After checking and saving the connection settings, click <b>Refresh Plug-ins List</b>. If the connection to the target device is working correctly, a list of the available plug-ins appears.
+</description>
+</item>
+
+<item
+ dialog="true"
+ href="/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/collect_prof_data_remotely.htm#Select"
+ skip="false"
+ title="Set plug-ins for tracing and prefix for created file.">
+<description>
+Select the plug-ins you want to trace from <b>Select Plug-ins for Tracing list</b>
+Enter the file prefix to be used for the trace data file.
+</description>
+</item>
+
+<item
+ dialog="true"
+ href="/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/collect_prof_data_remotely.htm#Stop"
+ skip="false"
+ title="Run the trace.">
+<description>
+Click <b>Start Tracing</b> to begin and carry out the use case with your application. When you are finished with the use case, click <b>Stop Tracing</b>. A new trace file name appears in the <b>Created Profiler Data Files</b>list.
+If you wish you can run another trace. Just enter a new prefix for the second file and change the setting if you wish.
+</description>
+</item>
+
+
+
+<item
+ dialog="true"
+ href="/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/an_load_trace_files.htm#Select_Known_Available_Information"
+ skip="false"
+ title="Finish the import">
+<description>
+Click <b>Next</b> to continue with the import.
+For detailed instructions, click the question mark icon to open the Help.
+</description>
+</item>
+
+<item title="Open the file for analysis" dialog="true" skip="false" href="/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/PI_view.htm">
+<description>
+ If you imported only one file, the data will open directly to the PI Analyser view.
+ If you imported several files, they will be listed in the PI view and you can double click on an item to view and analyse it in PI Analyzer.
+</description>
+</item>
+
+</cheatsheet>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/cheatsheets/getStarted_pi_cs.xml Wed Jun 23 14:49:59 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<cheatsheet title="Performance Investigator Setup">
- <intro>
- <description>
- Follow these steps to create a Performance Investigator project and analyze it.
- </description>
- </intro>
-
- <item title="Install the Profiler" href="/com.nokia.carbide.cpp.pi.doc.user/html/tasks/profiler/prof_installation.htm" skip="true" >
- <description>
- Transfer and install S60_3_1_Prof_v1_62.sisx file to the target device.
- </description>
- </item>
-
- <item title="Setup and Start Profiler" href="/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/prof_using.htm" skip="true" >
- <description>
- Setup Profiler on the target device and capture application data.
- </description>
- </item>
-
- <item title="Transfer Profiler Data File to PC" href="/com.nokia.carbide.cpp.pi.doc.user/html/tasks/profiler/usb_connection.htm" skip="true" >
- <description>
- Transfer the profiler data file to the PC by USB, Bluetooth, or serial interface connection.
- </description>
- </item>
-
- <item title="Import Profiler Data File" href="/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/an_load_trace_files.htm" skip="true" >
- <description>
- Import profiler data file in Carbide.c++ for analysis.
- </description>
- </item>
-
- <item title="Analyze Application Profile" href="/com.nokia.carbide.cpp.pi.doc.user/html/Getting_Started/example_project.htm" skip="false" >
- <description>
- Analyze the profiled application data within Carbide.c++.
- </description>
- </item>
-
-</cheatsheet>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/concepts/graphics_memory_usage_capture.htm Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Graphics Memory Usage Capture</title>
+ <link href="../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Graphics Memory Usage Capture</h2>
+<p> Use the Profiler application's <b>Memory usage capture</b> <a href="../reference/profiler/tracing_options.htm">option</a> to capture memory usage data on the target device. The data is stored in the profiler data file during a trace operation and can later be viewed in the Analyzer (Figure 1).</p>
+<p align="center"><img src="images/con_memory_usage.png" width="626" height="582"></p>
+<p class="figure">Figure 1. Memory Usage Capture information displayed in an analyser view. </p>
+<p>The Symbian OS API allocates memory in chunks. A chunk is a region of RAM mapped into contiguous linear addresses. At creation, a process has one to three chunks: </p>
+<ul>
+ <li>a stack/heap chunk contains the stack and heap used in the main thread of the process</li>
+ <li>a code chunk exists if the process is loaded into RAM</li>
+ <li>a data chunk exists if the process has static data</li>
+</ul>
+<p> A process can create more chunks, including global chunks accessible by other processes. When a chunk is created, is owned by the current process or the current thread.</p>
+<h5>Related references</h5>
+<ul>
+ <li><a href="../reference/analyzer/view_memory_usage.htm">Memory Usage View</a></li>
+ <li><a href="../reference/analyzer/menu_memory_graph.htm">Memory Graph Menu </a> </li>
+</ul>
+<h5>Related tasks</h5>
+<ul>
+ <li><a href="../reference/profiler/tracing_options.htm">Setting Tracing Options</a></li>
+</ul>
+<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
\ No newline at end of file
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/concepts/images/con_memory_usage.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/concepts/images/view_button_markers.png has changed
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/concepts/overview/overview.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/concepts/overview/overview.htm Wed Jun 23 15:05:09 2010 +0300
@@ -1,38 +1,79 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Overview</title>
- <link href="../../../book.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
-<h2>Overview</h2>
-<p>The Performance Investigator is a software performance measurement tool. The Performance Investigator collects run-time information from your application and other software running on a Symbian OS enabled device, such as a Nokia S60 phone, or a SEMC device running UIQ. The recorded information is then analyzed in the Performance Investigator analyzer software running on a PC.</p>
-<p>Performance Investigator currently supports the following:</p>
-<ul>
- <li>Nokia devices running S60 3.0 and 3.1 </li>
- <li>SEMC devices running UIQ 3.0</li>
- <li>Symbian TechView for Symbian OS 9.2, 9.3, 9.4, and 9.5</li>
-</ul>
-<p>The Performance Investigator collects performance data. It interrupts software execution at regular intervals and copies to memory the contents of some processor registers and the results of some Symbian OS calls.</p>
-<p>The Performance Investigator contains two main parts:</p>
-<ul>
- <li>First, on the target device is a user application called the Profiler. Installed with the Profiler is a device driver component that collects information from low-level (kernel and hardware-level) sources that are not generally accessed by application software. The Profiler acts as an interface to the device driver component and is required for its configuration, activation, and deactivation.</li>
- <li>Second, on the PC there is Performance Investigator code integrated with Carbide.c++. This software consists of an importer for processing profiler data and the Analyzer, which provides a user-friendly way to examine and analyze the run-time performance information.</li>
-</ul>
-<p>The following figure illustrates the basic scenario to gather and analyze software performance data. The target device contains the actual performance measurement instrumentation referred to as the Profiler. The data file imported by Carbide.c++ is analyzed on a PC workstation independent of the target device.</p>
-<p align="center"><img src="../../images/overview.png" width="537" height="336"></p>
-<p class="figure">Figure 1. Performance Investigator Tool: profiler and analyzer</p>
-<p>Performance measurements follow a pattern in which separate performance related activities are recorded to a profiler data file within the target device as distinct traces. Each trace represents an independent performance characteristic of the target device. When the profiler data file is imported by Carbide.c++, more information can be derived from the traces. Each trace can be independently analyzed. Furthermore, information gathered from the software at compile-time can be used in the analysis in order to exploit the cross-relations between elements of information available exclusively at run-time or at compile-time.</p>
-<p><strong>Related references </strong></p>
-<ul>
- <li><a href="sw_performance.htm">Software Performance</a></li>
-<li><a href="../../reference/profiler/profiler.htm">Profiler</a></li>
-<li><a href="../../reference/analyzer/analyser.htm">Analyzer</a></li>
-<li><a href="../../reference/abbrev.htm">Acronyms</a></li>
-</ul>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Overview</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Overview</h2>
+
+<p>The Performance Investigator is a software performance measurement tool. The
+Performance Investigator collects run-time information from your application
+and other software running on a Symbian OS enabled device, such as a Nokia S60
+phone.. The recorded information is then analyzed in the Performance
+Investigator analyzer software running on a PC.</p>
+
+<p>Performance Investigator currently supports the following:</p>
+<ul>
+ <li>Nokia devices running S60 3.0 and 3.1 </li>
+ <li>SEMC devices running UIQ 3.0</li>
+ <li>Symbian TechView for Symbian OS 9.2, 9.3, 9.4, and 9.5</li>
+</ul>
+
+<p>The Performance Investigator collects performance data. It interrupts
+software execution at regular intervals and copies to memory the contents of
+some processor registers and the results of some Symbian OS calls.</p>
+
+<p>The Performance Investigator contains two main parts:</p>
+<ul>
+ <li>First, on the target device is a user application called the Profiler.
+ Installed with the Profiler is a device driver component that collects
+ information from low-level (kernel and hardware-level) sources that are not
+ generally accessed by application software. The Profiler acts as an
+ interface to the device driver component and is required for its
+ configuration, activation, and deactivation.</li>
+ <li>Second, on the PC there is Performance Investigator code integrated with
+ Carbide.c++. This software consists of an importer for processing profiler
+ data and the Analyzer, which provides a user-friendly way to examine and
+ analyze the run-time performance information.</li>
+</ul>
+
+<p>The following figure illustrates the basic scenario to gather and analyze
+software performance data. The target device contains the actual performance
+measurement instrumentation referred to as the Profiler. The data file imported
+by Carbide.c++ is analyzed on a PC workstation independent of the target
+device.</p>
+
+<p align="center"><img src="../../images/overview.png" width="537"
+height="336"></p>
+
+<p class="figure">Figure 1. Performance Investigator Tool: profiler and
+analyzer</p>
+
+<p>Performance measurements follow a pattern in which separate performance
+related activities are recorded to a profiler data file within the target
+device as distinct traces. Each trace represents an independent performance
+characteristic of the target device. When the profiler data file is imported by
+Carbide.c++, more information can be derived from the traces. Each trace can be
+independently analyzed. Furthermore, information gathered from the software at
+compile-time can be used in the analysis in order to exploit the
+cross-relations between elements of information available exclusively at
+run-time or at compile-time.</p>
+
+<p><strong>Related references </strong></p>
+<ul>
+ <li><a href="sw_performance.htm">Software Performance</a></li>
+ <li><a href="../../reference/profiler/profiler.htm">Profiler</a></li>
+ <li><a href="../../reference/analyzer/analyser.htm">Analyzer</a></li>
+ <li><a href="../../reference/abbrev.htm">Acronyms</a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/context_help/com_nokia_carbide_pi_address.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/context_help/com_nokia_carbide_pi_address.xml Wed Jun 23 15:05:09 2010 +0300
@@ -11,6 +11,7 @@
<description>Use the Threads view to display the Threads Load.</description>
<topic label="Thread Load" href="html/reference/analyzer/thread_load.htm" />
<topic label="Analyzer view" href="html/reference/analyzer/main_view.htm" />
+ <topic href="html/reference/analyzer/view_CPU.htm" label="CPU Views"/>
<topic label="Using the Analyzer" href="html/reference/analyzer/an_use_case_features.htm" />
<topic label="Examining a Profiling Project" href="html/Getting_Started/example_project.htm" />
<topic label="Setting Time Interval" href="html/tasks/analyser/time_interval.htm" />
@@ -23,6 +24,7 @@
<description>Use the Binaries view to display the Binary Load.</description>
<topic label="Binary Load" href="html/reference/analyzer/binary_load.htm" />
<topic label="Analyzer view" href="html/reference/analyzer/main_view.htm" />
+ <topic href="html/reference/analyzer/view_CPU.htm" label="CPU Views"/>
<topic label="Using the Analyzer" href="html/reference/analyzer/an_use_case_features.htm" />
<topic label="Examining a Profiling Project" href="html/Getting_Started/example_project.htm" />
<topic label="Setting Time Interval" href="html/tasks/analyser/time_interval.htm" />
@@ -40,6 +42,7 @@
<topic label="Setting Time Interval" href="html/tasks/analyser/time_interval.htm" />
<topic label="Setting Thresholds" href="html/tasks/analyser/set_thresholds.htm" />
<topic label="Changing Graph Colors" href="html/tasks/analyser/chng_graphcolor.htm" />
+ <topic href="html/reference/analyzer/view_CPU.htm" label="CPU Views"/>
</context>
</contexts>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/context_help/com_nokia_carbide_pi_graphicsmemory.xml Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<!-- Define help for Debug Perspective default views -->
+<!-- plugin="com.nokia.carbide.cpp.pi.graphicsmemory" -->
+
+<contexts>
+
+ <!-- THREAD TAB -->
+ <context id="graphicsMemoryPageContext" >
+ <description>Use the Graphics Memory Usage view to display and analyse the Graphics Memory usage data.</description>
+ <topic href="html/reference/analyzer/view_graphics_memory_usage.htm" label="Graphics Memory Usage View"/>
+ <topic label="Graphics Memory Graph Menu" href="html/reference/analyzer/menu_graphics_memory_graph.htm" />
+ <topic href="html/reference/analyzer/wnd_graphics_memory_usage_statistics.htm" label="Graphics Memory Usage Statistics"/>
+ <topic label="Analyzer view" href="html/reference/analyzer/main_view.htm" />
+ <topic label="Using the Analyzer" href="html/reference/analyzer/an_use_case_features.htm" />
+ <topic label="Setting Time Interval" href="html/tasks/analyser/time_interval.htm" />
+ </context>
+
+ <!-- BINARIES TAB -->
+
+ <!-- FUNCTIONS TAB -->
+
+</contexts>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/context_help/com_nokia_carbide_pi_pec.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/context_help/com_nokia_carbide_pi_pec.xml Wed Jun 23 15:05:09 2010 +0300
@@ -11,8 +11,9 @@
<description>Use the Performance Counters view to visualise profiling data from performance counters.</description>
<topic label="Performance Counters View" href="html/reference/analyzer/view_performance_counters.htm" />
<topic href="html/reference/analyzer/traceable_events.htm" label="Traceable Event Types"/>
+ <topic href="html/reference/analyzer/MIPS_counter_graph.htm" label="MIPS Counter and Graph"/>
+ <topic href="html/reference/analyzer/view_IPC.htm" label="Interconnect Performance Counters View"/>
<topic href="html/reference/analyzer/main_view.htm" label="Analyzer View"/>
- <topic href="html/reference/analyzer/view_IPC.htm" label="Interconnect Performance Counters View"/>
<topic label="Using the Analyzer" href="html/reference/analyzer/an_use_case_features.htm" />
<topic label="Setting Time Interval" href="html/tasks/analyser/time_interval.htm" />
<topic href="html/reference/profiler/Prof_counter_settings.htm" label="PIProfiler Performance Counter Settings"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/context_help/com_nokia_carbide_pi_view.xml Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<!-- Define help for Debug Perspective default views -->
+<!-- plugin="com.nokia.carbide.cpp.pi.view" -->
+
+<contexts>
+ <context id="pi_view_context">
+ <description>Performance Investigator View provides a list of imported PI Profiler data files. Double click on an item to open it for viewing in PI Analyser.</description>
+ <topic href="html/reference/analyzer/PI_view.htm" label="PI View description and instructions"/>
+ </context>
+</contexts>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/context_help/com_nokia_carbide_pi_wizards.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/context_help/com_nokia_carbide_pi_wizards.xml Wed Jun 23 15:05:09 2010 +0300
@@ -19,6 +19,7 @@
<context id="import_wizard_input_page_context" >
<description>Profiler data files contain run-time performance information of your test runs.</description>
<topic label="Select Profiler Data File" href="html/tasks/analyser/an_load_trace_files.htm#Select_Profiler_Data_File" />
+ <topic href="html/tasks/analyser/collect_prof_data_remotely.htm" label="Collecting Profiler Data Remotely"/>
</context>
<context id="import_wizard_output_page_context" >
@@ -55,5 +56,7 @@
<description>Import Key Map Profile</description>
<topic label="Import key press mapping" href="html/tasks/profiler/key_profile_imp.htm" />
</context>
+ <context id="Help_Context">
+ </context>
</contexts>
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/images/GS_example_figure1.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/images/GS_example_figure2.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/images/GS_example_figure3.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/images/GS_example_figure4.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/images/icons/pi.gif has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/images/icons/pi_hov.gif has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/images/wnd_import_rom_build_files.png has changed
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/profiler.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/profiler.htm Wed Jun 23 15:05:09 2010 +0300
@@ -37,7 +37,7 @@
<td colspan="2"><h1 align="center">Performance Investigator User Guide
</h1>
- <p align="center" class="titleSmall">Version 2.3.0; April, 2010</p>
+ <p align="center" class="titleSmall">Version 2.4.0; June, 2010</p>
</td>
</tr>
</tbody>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/MIPS_counter_graph.htm Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>MIPS Counter and Graph</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>MIPS Counter and Graph</h2>
+
+<p>The Million Instructions Per Second (MIPS) graph gives you a general idea of
+CPU speed in a measured use case. The basic use case for the MIPS analysis
+would be to check any low areas in the graph since they may reveal unoptimized
+features, for example, in terms of memory access (reads and writes). The higher
+the MIPS values, the better and the faster the CPU is in executing
+instructions.</p>
+
+<p>A MIPS (Million Instructions Per Millisecond) graph is displayed in the
+Performance Counters view, when <b>Instructions executed</b> has been selected
+as one of the profiled counters. From PI Profiler version 2.2.1. onwards, CPU
+speed data is included when "Instructions executed" profiled. For files created
+with earlier PI Profiler versions, the dialog below is displayed during
+PIAnalyser file import:</p>
+
+<p align="center"><img src="images/MIPS_speed_dialog.png"></p>
+
+<p class="figure">Figure 1. MIPS Graph Generation</p>
+
+<p>The processor speed information is needed for calculating the data for the
+MIPS graph. The rest of the data for the calculation is always included in the
+<b>Instructions executed</b> and <b>CPU cycles</b> counters.</p>
+
+<p style="text-align:center"><img src="images/PEC_view_MIPS.png"></p>
+
+<p>The MIPS counter information is displayed in the graphs view and the legend
+table together with the other performance counters. Note, however, that for
+MIPS only <b>Average (1/ms)</b>, <b>Min (1/ms)</b>, and <b>Max (1/ms)</b>
+information is displayed in the legend table.</p>
+
+<p>When the CPU speed data is included in the imported Profiler data file, a
+CPU clock rate counter and graph are also displayed in the <a
+href="view_performance_counters.htm">Performance Counters View</a>.</p>
+
+<h4>Related references </h4>
+<ul>
+ <li><a href="view_performance_counters.htm">Performance Counters View</a></li>
+ <li><a href="traceable_events.htm">Traceable Event Types</a></li>
+ <li><a href="../profiler/Prof_counter_settings.htm">PIProfiler Performance
+ Counter Settings</a></li>
+ <li><a href="main_view.htm">Analyzer View</a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/PI_view.htm Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Performance Investigator View</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Performance Investigator View</h2>
+
+<p>Performance Investigator View is available in the bottom right hand corner
+of the Carbide.c++ workbench after <a
+href="../../tasks/analyser/an_load_trace_files.htm">Profiler data file
+import</a>, or you can open it by selecting <strong>Carbide</strong> >
+<strong>Performance Investigator</strong>.</p>
+
+<p>The view is linked to the Carbide Project view, so it lists the same files,
+and reflects the changes made in the Project view.</p>
+
+<p><img src="images/PI_view.png"></p>
+
+<p>In additions to the names of the imported Trace <strong>Files</strong>,
+Performance Investigator view includes the following information for each
+file:</p>
+<ul>
+ <li><strong>Project</strong>: Name of the project where the Profiler data
+ file is located</li>
+ <li><strong>SDK</strong>: SDK version used during import</li>
+ <li><strong>Import time</strong>: Shows the time when the file was imported,
+ used for sorting the data files in chronological order</li>
+ <li><strong>File Size (KB)</strong>: Size of the Profiler data file</li>
+ <li><strong>Time (mm:ss)</strong>: Time used for profiling</li>
+</ul>
+
+<p>You can <strong>open an item</strong> from the list to <a
+href="main_view.htm">PI Analyser view</a> by double-clicking on it.</p>
+
+<p>To <strong>remove an item</strong> from the view, right-click on it and
+select remove, or click on the <img src="images/icon_remove.png"> icon on the
+toolbar.</p>
+
+<p>The view also provides <strong>shortcuts</strong> from the toolbar</p>
+<ul>
+ <li><img src="images/open_pi_wizard.png">
+ to the <strong>Performance Investigator Import Wizard</strong>, and</li>
+ <li><img src="images/open_key_press_profile_wizard.png"> to the <strong>Key Press Profile Import Wizard</strong>.</li>
+</ul>
+
+<h4>Related references</h4>
+<ul>
+ <li><a href="main_view.htm">Analyser View</a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/context_menu.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/context_menu.htm Wed Jun 23 15:05:09 2010 +0300
@@ -3,7 +3,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <title></title>
+ <title>Context Menu Options</title>
<link href="../../../book.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
@@ -109,8 +109,14 @@
</tr>
<tr>
<td><b>Dynamically Rescale Based on Selected Threads </b></td>
- <td>Right-click in Memory Usage graph and select this option to rescale
- the graph based on selected threads. </td>
+ <td>Right-click in the Memory Usage graph and select this option to
+ rescale the graph based on selected threads. </td>
+ </tr>
+ <tr>
+ <td><strong>Dynamically Rescale Based on Selected Process</strong> </td>
+ <td>Right-click in the Graphics Memory Usage graph and select this option
+ to rescale the graph based on the memory usage of the selected
+ process(es).</td>
</tr>
<tr>
<td><b>Function Only </b></td>
@@ -127,10 +133,16 @@
functions called.</td>
</tr>
<tr>
+ <td><b>Graphics Memory Usage Statistics </b></td>
+ <td>Right-click on the Graphic Memory Usage graph and select this menu
+ option to open a Graphics Memory Usage Statistics dialog box that
+ reports memory use for the selected time interval.</td>
+ </tr>
+ <tr>
<td><b>Memory Usage Statistics </b></td>
- <td>Right-click in Memory Usage graph and select this menu option to open
- a Memory Usage Statistics dialog box that reports memory use for the
- selected time interval.</td>
+ <td>Right-click on the Memory Usage graph and select this menu option to
+ open a Memory Usage Statistics dialog box that reports memory use for
+ the selected time interval.</td>
</tr>
<tr>
<td><b>Open Source for Function </b></td>
@@ -141,7 +153,7 @@
<td><b>Power Usage Settings...</b></td>
<td>Right-click in the Power Usage graph and select this menu option to
display a dialog box that reports the voltage and battery capacity. The
- values can be modifed as mentioned in <a
+ values can be modified as mentioned in <a
href="wnd_power_graph_settings.htm">Power Usage Settings</a>.</td>
</tr>
<tr>
@@ -238,6 +250,13 @@
be selected for the table to be saved.</td>
</tr>
<tr>
+ <td><strong>Scale to CPU Clock Speed</strong></td>
+ <td>This option is available in the CPU Thread Load view when CPU clock
+ rate counter is available in the sampled performance counter data.
+ Select this option to scale both the graph and the % Load column of the
+ legend table according to the CPU clock speed. </td>
+ </tr>
+ <tr>
<td><b>Select All</b></td>
<td>Selects the entire table in the current pane.</td>
</tr>
@@ -278,6 +297,11 @@
graph.</td>
</tr>
<tr>
+ <td><b>Show Total Graphics Memory Usage</b></td>
+ <td>Displays or disables the Total Graphics Memory Usage line on the
+ Graphics Memory Usage graph.</td>
+ </tr>
+ <tr>
<td><b>Sort by Binary Path, then Binary Name </b></td>
<td>In the Binaries and Functions table views, this option will
alphabetically sort the path of binaries, then alphabetically sort the
@@ -287,7 +311,7 @@
</tr>
<tr>
<td><strong>Switch Key Press Profile</strong> </td>
- <td>Opens a dialog that allows you to change the<a
+ <td>Opens a dialog that allows you to change the <a
href="../../tasks/analyser/key_profile_switch.htm">key map profile</a>
associated with the current NPI file.</td>
</tr>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/function_calls.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/function_calls.htm Wed Jun 23 15:05:09 2010 +0300
@@ -1,47 +1,91 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Function Calls</title>
- <link href="../../../book.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
-<h2>Function Calls</h2>
-<p>If the profiler data file contained function call information, select the Function Calls tab to show information about the function call relationships during the selected time period. Figure 1 shows an example set of tables that provide information about function calls.</p>
-<p align="center"><img src="images/function_call_info.png" width="764" height="609"></p>
-<p class="figure">Figure 1. Function Call Information</p>
-<p>Only one function can be selected at a time. For the selected function, you can see the functions that have been found calling it and the functions that it has called. Additional columns provide more information, such as the percentage of each functions activity based on 100 percent of all calls to and from the selected function, Function's starting address (in hex), binary where function exists, and the path of the binary.</p>
-<p>Description of table columns:<br>
- (for all tables)</p>
-<ul>
- <li>The <strong>Function Start</strong> column displays the hexadecimal start address of each function.</li>
-<li>The <strong>In Binary</strong> column tells(s) the binary containing each function.</li>
-<li>The <strong>Path of Binary</strong> column shows the PC folder containing each function’s binary.</li>
-<li>The<strong> Is Caller %</strong> column shows the percentage of time that this function was the caller of the function that was executing.</li>
-<li>The <strong>Is Called %</strong> column shows the percentage of time in the selected time period that this function was executing.</li>
-</ul>
-<p>(in the <strong>Select One Function</strong> table)</p>
-<ul>
- <li>The <strong>Called Samples</strong> column shows the number of samples in which this function was executing.</li>
-<li>The <strong>Caller Samples</strong> column displays the number of samples in which this function was the caller of the function that was executing.</li>
-</ul>
-<p>The selected function may have been called from one or more functions. In the <strong>Functions calling the selected function</strong> table, the <strong>% of Calls</strong> column shows what percentage of the time the selected function was called by each function in the table. For each function in this table, the <strong>Is Caller %</strong> column indicates the percentage of samples that the function was the caller of the executing function.</p>
-<p>The selected function may have called one or more functions. In the <strong>Functions called by the selected function</strong> table, the <strong>% of Calls</strong> column shows what percent of the time the selected function called each function in the table. For each function in this table, the <strong>Is Called %</strong> column indicates in what percentage of samples the function was executing.</p>
-<p class="note"><strong>NOTE</strong>
-On the target device, the link register usually contains the return address of the caller function.
-However, a called function may temporarily use the link register to hold a constant or variable.
-Performance Investigator uses link register values in the profiler data file to determine the names
-of caller functions.
-When PI cannot determine the name of a caller function, it may be because the link register held a constant
-or variable. For example, if the link register held a constant 0x0, PI would display the caller's name as "Function at 0x0 not found". </p>
-<p><strong>Related references</strong></p>
-<ul>
- <li><a href="binary_load.htm">Binary Load</a></li>
- <li><a href="function_load.htm">Function Load</a></li>
- <li><a href="thread_load.htm">Thread Load</a></li>
-</ul>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Function Calls</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Function Calls</h2>
+
+<p>If the profiler data file contained function call information, select the
+Function Calls tab to show information about the function call relationships
+during the selected time period. Figure 1 shows an example set of tables that
+provide information about function calls.</p>
+
+<p align="center"><img src="images/function_call_info.png" width="764"
+height="609"></p>
+
+<p class="figure">Figure 1. Function Call Information</p>
+
+<p>Only one function can be selected at a time. For the selected function, you
+can see the functions that have been found calling it and the functions that it
+has called. Additional columns provide more information, such as the percentage
+of each functions activity based on 100 percent of all calls to and from the
+selected function, Function's starting address (in hex), binary where function
+exists, and the path of the binary.</p>
+
+<p>Description of table columns:<br>
+(for all tables)</p>
+<ul>
+ <li>The <strong>Function Start</strong> column displays the hexadecimal start
+ address of each function.</li>
+ <li>The <strong>In Binary</strong> column tells(s) the binary containing each
+ function.</li>
+ <li>The <strong>Path of Binary</strong> column shows the PC folder containing
+ each function’s binary.</li>
+ <li>The<strong>Is Caller %</strong> column shows the percentage of time that
+ this function was the caller of the function that was executing.</li>
+ <li>The <strong>Is Called %</strong> column shows the percentage of time in
+ the selected time period that this function was executing.</li>
+</ul>
+
+<p>(in the <strong>Select One Function</strong> table)</p>
+<ul>
+ <li>The <strong>Called Samples</strong> column shows the number of samples in
+ which this function was executing.</li>
+ <li>The <strong>Caller Samples</strong> column displays the number of samples
+ in which this function was the caller of the function that was
+ executing.</li>
+</ul>
+
+<p>The selected function may have been called from one or more functions. In
+the <strong>Functions calling the selected function</strong> table, the
+<strong>% of Calls</strong> column shows what percentage of the time the
+selected function was called by each function in the table. For each function
+in this table, the <strong>Is Caller %</strong> column indicates the percentage
+of samples that the function was the caller of the executing function.</p>
+
+<p>The selected function may have called one or more functions. In the
+<strong>Functions called by the selected function</strong> table, the <strong>%
+of Calls</strong> column shows what percent of the time the selected function
+called each function in the table. For each function in this table, the
+<strong>Is Called %</strong> column indicates in what percentage of samples the
+function was executing.</p>
+
+<p class="note"><strong>NOTE</strong> On the target device, the link register
+usually contains the return address of the caller function. However, a called
+function may temporarily use the link register to hold a constant or variable.
+Performance Investigator uses link register values in the profiler data file to
+determine the names of caller functions. When PI cannot determine the name of a
+caller function, it may be because the link register held a constant or
+variable. For example, if the link register held a constant 0x0, PI would
+display the caller's name as "Function at 0x0 not found". </p>
+
+<p><strong>Related references</strong></p>
+<ul>
+ <li><a href="main_view.htm">Analyzer View</a></li>
+ <li><a href="binary_load.htm">Binary Load</a></li>
+ <li><a href="function_load.htm">Function Load</a></li>
+ <li><a href="thread_load.htm">Thread Load</a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/PEC_view_MIPS.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/PI_view.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/analyzer_mainview.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/function_call_info.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/graphics_memory_graph_drop_down.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/graphics_memory_usage_stats.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/icon_remove.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/menu_graphics_memory_usage.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/open_key_press_profile_wizard.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/open_pi_wizard.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/images/view_graphics_memory_usage.png has changed
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/import_rom_build_files.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/import_rom_build_files.htm Wed Jun 23 15:05:09 2010 +0300
@@ -1,45 +1,45 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
-<head>
- <meta http-equiv="Content-Type"
- content="text/html; charset=iso-8859-1">
- <title>Select Build Files for ROM</title>
- <link href="../../../book.css" rel="stylesheet" type="text/css">
-</head>
-<body>
-<h2>Select Build Files for ROM </h2>
-<p>Use the <strong>Select build files from ROM</strong> dialog to select the build files that correspond to the ROM on the device. Start by selecting the SDK, then the ROM OBY file as well as the ROM symbol file. </p>
-<p align="center"><img src="../../images/wnd_import_rom_build_files.png" width="629" height="705"></p>
-<p class="figure">Figure 1. Select build files from ROM dialog </p>
-<h5>Table 1. <strong>Select build files from ROM</strong> — options </h5>
-<table width="778"
-border="0" cellpadding="2" cellspacing="0">
- <tr valign="top">
- <th width="266" class="Cell">Menu Item </th>
- <th width="502" class="Cell">Description</th>
- </tr>
- <tr valign="top">
- <td class="Cell"><strong>Installed SDK </strong></td>
- <td class="Cell">Shows a list of the currently installed SDKs. Use <strong>Add SDK..</strong>. to open the <strong>Add New SDK</strong> dialog where you can define the SDK to use. Use <strong>Remove SDK</strong> to remove the selected SDK from the <span class="code">devices.xml</span> file and the <strong>Installed SDK</strong> list. The SDK is not removed from from the drive. </td>
- </tr>
- <tr valign="top">
- <td class="Cell"><p><strong>ROM OBY File </strong></p></td>
- <td class="Cell"><p>Type a ROM OBY file name or click ROM OBY File... to locate a ROM OBY file.</p></td>
- </tr>
- <tr valign="top">
- <td class="Cell"><strong>ROM Symbol File </strong></td>
- <td class="Cell">Type a ROM symbol file name or click ROM Symbol File... to locate a ROM symbol file. </td>
- </tr>
- <tr valign="top">
- <td class="Cell"><strong>ROFS OBY/Symbol File Pairs </strong></td>
- <td class="Cell"><p>Click <strong>Add...</strong> to add a ROFS OBY/Symbol File pair. Click <strong>Remove...</strong> to remove the selected ROFS OBY/Symbol File pair from the list. </p> </td>
- </tr>
-</table>
-<p align="left"><strong>Related references</strong></p>
-<ul>
- <li><a href="main_view.htm" align="left">Analyzer
-View</a></li>
-</ul>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <title>Select Build Files for ROM</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+<body>
+<h2>Select Build Files for ROM </h2>
+<p>Use the <strong>Select build files from ROM</strong> dialog to select the build files that correspond to the ROM on the device. Start by selecting the SDK, then the ROM OBY file as well as the ROM symbol file. </p>
+<p align="center"><img src="../../images/wnd_import_rom_build_files.png"></p>
+<p class="figure">Figure 1. Select build files from ROM dialog </p>
+<h5>Table 1. <strong>Select build files from ROM</strong> — options </h5>
+<table width="778"
+border="0" cellpadding="2" cellspacing="0">
+ <tr valign="top">
+ <th width="266" class="Cell">Menu Item </th>
+ <th width="502" class="Cell">Description</th>
+ </tr>
+ <tr valign="top">
+ <td class="Cell"><strong>Installed SDK </strong></td>
+ <td class="Cell">Shows a list of the currently installed SDKs. Use <strong>Add SDK..</strong>. to open the <strong>Add New SDK</strong> dialog where you can define the SDK to use. Use <strong>Remove SDK</strong> to remove the selected SDK from the <span class="code">devices.xml</span> file and the <strong>Installed SDK</strong> list. The SDK is not removed from from the drive. </td>
+ </tr>
+ <tr valign="top">
+ <td class="Cell"><p><strong>ROM OBY File </strong></p></td>
+ <td class="Cell"><p>Type a ROM OBY file name or click ROM OBY File... to locate a ROM OBY file.</p></td>
+ </tr>
+ <tr valign="top">
+ <td class="Cell"><strong>ROM Symbol File </strong></td>
+ <td class="Cell">Type a ROM symbol file name or click ROM Symbol File... to locate a ROM symbol file. </td>
+ </tr>
+ <tr valign="top">
+ <td class="Cell"><strong>ROFS OBY/Symbol File Pairs </strong></td>
+ <td class="Cell"><p>Click <strong>Add...</strong> to add a ROFS OBY/Symbol File pair. Click <strong>Remove...</strong> to remove the selected ROFS OBY/Symbol File pair from the list. </p> </td>
+ </tr>
+</table>
+<p align="left"><strong>Related references</strong></p>
+<ul>
+ <li><a href="main_view.htm" align="left">Analyzer
+View</a></li>
+</ul>
+<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/investigator_menu.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/investigator_menu.htm Wed Jun 23 15:05:09 2010 +0300
@@ -47,6 +47,17 @@
<p></p>
+<p>For information on Investigator menu options for the Graphics Memory Usage
+view, Memory Usage View and Power Usage view, see: </p>
+<ul>
+ <li><a href="menu_graphics_memory_graph.htm">Graphics Memory Graph menu
+ </a></li>
+ <li><a href="menu_memory_graph.htm">Memory Graph menu </a></li>
+ <li><a href="menu_power_graph.htm">Power Graph menu</a></li>
+</ul>
+
+<p></p>
+
<p>In SMP systems with more than one CPU, two additional options are included
in the investigator menu for viewing combined or separate CPU graphs. See
Figure 2 below.</p>
@@ -77,8 +88,12 @@
</tbody>
</table>
+<p></p>
+
<h5>Related references</h5>
<ul>
+ <li><a href="menu_graphics_memory_graph.htm">Graphics Memory Graph menu
+ </a></li>
<li><a href="menu_memory_graph.htm">Memory Graph menu </a></li>
<li><a href="menu_power_graph.htm">Power Graph menu</a></li>
</ul>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/main_view.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/main_view.htm Wed Jun 23 15:05:09 2010 +0300
@@ -11,13 +11,11 @@
<h2>Analyzer View</h2>
<p>The main analysis view is visible after trace data taken by Profiler has
-been imported into Carbide.c++ and opened with Analyzer. The thread load data
-in the main analysis view is built from the address/thread trace. Other trace
-data is also shown in the main analysis view, such as dynamic binary support
-trace and function call trace. Figure 1 is an example view of imported profiler
-data that has been opened with the analyzer, including memory and power usage
-information, with a time interval of 4 to 8 seconds selected.The Interrups
-graph and Performance Counters graph have been minized.</p>
+been imported into Carbide.c++ and opened with Analyzer. Figure 1 is an example
+view of imported profiler data that has been opened with the analyzer,
+including memory and power usage information, with a time interval of 4 to 8
+seconds selected.The Interrups graph and Performance Counters graph have been
+minized.</p>
<p align="center"><img src="images/analyzer_mainview.png" width="679"
height="770"> </p>
@@ -25,36 +23,29 @@
<p align="center" class="figure">Figure 1. Analyzer main view showing Thread,
Memory, and Power graphs</p>
-<p>The address/thread trace graph is the most generic and perhaps most
-informative visual of the sampled data. The different colors represent
-different items. Time is represented on the horizontal axis of the graph and
-share of CPU use is represented on the vertical axis. You can select Thread
-load, Binary load, or Function load by selecting the respective tabs at the
-bottom of the main view, as shown in Figure 2.</p>
-
-<p align="center"><img src="images/analz_loads_tabs.png" width="423"
-height="84"></p>
+<p>You can select a portion of the graph by clicking on the graph. The legend
+table beneath the graph displays information about the currently selected part
+of the graph. For example, thread load statistics are shown in the table if the
+thread load graph is selected.</p>
-<p align="center" class="figure">Figure 2. Selecting Threads, Binaries,
-Functions, or Function Calls</p>
+<p>You can use the buttons on the title bars to manipulate what is displayed in
+Analyser. For more information, see <a href="GUI_tour.htm">Analyzer GUI
+Controls</a>. </p>
-<p>Each of the lines in the thread table represents a single thread. The color
-codes in the thread list correspond to the colors in the thread load graphs.
-Therefore, each color in the thread load graph represents the load of its
-corresponding thread.</p>
-
-<p>You can select a portion of the graph by clicking on the trace graph. The
-legend table beneath the graph displays information about the currently
-selected part of the graph. For example, thread load statistics are shown in
-the table if the thread load graph is selected.</p>
+<p>For more specific information on all the views and graps available in PI
+Analyser, use the links below in Related references.</p>
<p><strong>Related references</strong></p>
<ul>
- <li><a href="GUI_tour.htm">Analyzer GUI Controls </a></li>
- <li><a href="thread_load.htm">Thread Load</a></li>
- <li><a href="binary_load.htm">Binary Load</a></li>
- <li><a href="function_load.htm">Function Load</a></li>
- <li><a href="function_calls.htm">Function Calls</a></li>
+ <li><a href="view_CPU.htm">CPU Views</a></li>
+ <li><a href="view_memory_usage.htm">Memory Usage view</a></li>
+ <li><a href="view_graphics_memory_usage.htm">Graphics Memory Usage
+ view</a></li>
+ <li><a href="view_power_usage.htm">Power Usage view</a></li>
+ <li><a href="interrupts_view.htm">Interrupts view</a></li>
+ <li><a href="view_performance_counters.htm">Performance Counters view</a></li>
+ <li><a href="view_IPC.htm">Interconnect Performance Counters view</a></li>
+ <li><a href="GUI_tour.htm">Analyzer GUI Controls</a></li>
</ul>
<div id="footer">
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/menu_graphics_memory_graph.htm Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,90 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Graphics Memory Graph Menu</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Graphics Memory Graph Menu </h2>
+
+<p>The <strong>Graphics Memory Graph</strong> menu is available whenever a
+<span class="code">.npi</span> data file is opened that contains graphics
+memory usage trace data. Use it to modify how the graph is calculated, to view
+graphics memory statistics, and control how the memory information is
+displayed. </p>
+
+<p align="center"><img src="images/menu_graphics_memory_usage.png"></p>
+
+<p class="figure">Figure 1. Graphics Memory Graph menu items </p>
+
+<h5>Table 1. Memory Graph —menu items </h5>
+
+<table width="778" border="0" cellpadding="2" cellspacing="0">
+ <tbody>
+ <tr valign="top">
+ <th width="236" class="Cell">Menu Item </th>
+ <th width="532" class="Cell">Description</th>
+ </tr>
+ <tr valign="top">
+ <td class="Cell"><b>Graphics Memory Usage Statistics </b></td>
+ <td class="Cell">Open the <a
+ href="wnd_graphics_memory_usage_statistics.htm">Graphics Memory Usage
+ Statistics</a> dialog. </td>
+ </tr>
+ <tr valign="top">
+ <td class="Cell"><p><b>Private Usage </b></p>
+ </td>
+ <td class="Cell"><p>Select <b>Private Usage</b> to show only private
+ graphics memory usage. Shared memory usage is not included in the
+ graph. The graph refreshes and scales the vertical axis to cover the
+ maximum private usage of the entire graph or the current selected
+ processes. </p>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td class="Cell"><b>Shared Usage </b></td>
+ <td class="Cell">Select <b>Shared Usage</b> to show shared graphics
+ memory usage only. Private memory usage is not included in the
+ graph..</td>
+ </tr>
+ <tr valign="top">
+ <td class="Cell"><b>Private and Shared Usage </b></td>
+ <td class="Cell">This is the default setting showing both the private and
+ shared usage portions of the graph.</td>
+ </tr>
+ <tr valign="top">
+ <td class="Cell"><b>Dynamically Rescale Based on Selected Process
+ </b></td>
+ <td class="Cell">Enable to rescale the vertical axis of the graph
+ according to the maximum amount memory by the processes currently
+ selected in the Graphics Memory Usage table. When disabled, rescales
+ the vertical axis to the maximum memory usage of all processes in the
+ entire graph. The default settings is disabled. </td>
+ </tr>
+ <tr>
+ <td><b>Show Total Graphics Memory Usage</b></td>
+ <td>Displays or disables the Total Graphics Memory Usage line on the
+ Memory Usage graph.</td>
+ </tr>
+ </tbody>
+</table>
+
+<p><strong>Related references </strong></p>
+<ul>
+ <li><a href="main_view.htm">Analyzer View</a></li>
+ <li><a href="view_graphics_memory_usage.htm">Graphics Memory Usage
+ View</a></li>
+ <li><a href="wnd_graphics_memory_usage_statistics.htm">Graphics Memory Usage
+ Statistics</a> </li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/menu_memory_graph.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/menu_memory_graph.htm Wed Jun 23 15:05:09 2010 +0300
@@ -11,10 +11,9 @@
<h2>Memory Graph Menu </h2>
<p>The <strong>Memory Graph</strong> menu is available whenever a <span
-class="code">.npi</span> or <span class="code">.bap</span> data file is opened
-that contains memory usage trace data. Use it to modify how the graph is
-calculated, view memory statistics, and control how the memory information is
-displayed. </p>
+class="code">.npi</span> data file is opened that contains memory usage trace
+data. Use it to modify how the graph is calculated, view memory statistics, and
+control how the memory information is displayed. </p>
<p align="center"><img src="images/menu_memory_usage.png"></p>
@@ -35,26 +34,27 @@
dialog. </td>
</tr>
<tr valign="top">
- <td class="Cell"><p><b>Show Chunk Usage </b></p>
+ <td class="Cell"><p><b>Chunk Usage </b></p>
</td>
- <td class="Cell"><p>Select<b>Show Chunk Usage</b> to show chunks
- allocated to threads. Heap threads are not included. The graph
- refreshes and scales the vertical axis to cover the maximum non-heap
- chunk usage of the entire graph or the current selected threads. </p>
+ <td class="Cell"><p>Select <b>Chunk Usage</b> to show chunks allocated to
+ threads. Heap threads are not included. The graph refreshes and scales
+ the vertical axis to cover the maximum non-heap chunk usage of the
+ entire graph or the current selected threads. </p>
</td>
</tr>
<tr valign="top">
- <td class="Cell"><b>Show Stack/Heap Usage </b></td>
- <td class="Cell">Select<b>Show Stack/Heap Usage</b> to show thread heap
+ <td class="Cell"><b>Stack/Heap Usage </b></td>
+ <td class="Cell">Select <b>Stack/Heap Usage</b> to show thread heap
chunks.</td>
</tr>
<tr valign="top">
- <td class="Cell"><b>Show Current and Stack/Heap Usage </b></td>
- <td class="Cell">This is the default setting showing both the current and
+ <td class="Cell"><b>Chunk and Stack/Heap Usage </b></td>
+ <td class="Cell">This is the default setting showing both the chunk and
stack/heap usage portions of the graph.</td>
</tr>
<tr valign="top">
- <td class="Cell"><b>Dynamically Rescale to Selected Threads </b></td>
+ <td class="Cell"><b>Dynamically Rescale Based on Selected Threads
+ </b></td>
<td class="Cell">Enable to rescale the vertical axis of the graph to the
maximum memory usage in the entire graph by the threads currently
checked in the CPU load table. When disabled, rescale the vertical axis
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/thread_load.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/thread_load.htm Wed Jun 23 15:05:09 2010 +0300
@@ -10,12 +10,20 @@
<body>
<h2>Thread Load</h2>
-<p>Select the Threads tab to display the Thread Load. The Thread Load graph and
-related table show information about threads that were active during the
-selected time period. The graph and table show the CPU load separated according
-to the executed thread, independent of the binary or function in which
-execution took place. Figure 1 shows an example graph with the Threads tab
-selected.</p>
+<p>Select the Threads tab to display the Thread Load. The thread load data in
+the main analysis view is built from the address/thread trace. The Thread Load
+graph and related table show information about threads that were active during
+the selected time period. The graph and table show the CPU load separated
+according to the executed thread, independent of the binary or function in
+which execution took place. Figure 1 shows an example graph with the Threads
+tab selected.</p>
+
+<p>The address/thread trace graph is the most generic and perhaps most
+informative visual of the sampled data. The different colors represent
+different items. Time is represented on the horizontal axis of the graph and
+share of CPU use is represented on the vertical axis.</p>
+
+<p></p>
<p align="center"><img src="images/thread_mode_graph.png" width="710"
height="728"> </p>
@@ -23,6 +31,11 @@
<p align="center" class="figure">Figure 1. Thread Load Graph displaying
combined CPU graph</p>
+<p>Each of the lines in the thread table represents a single thread. The color
+codes in the thread list correspond to the colors in the thread load graphs.
+Therefore, each color in the thread load graph represents the load of its
+corresponding thread.</p>
+
<p>Description of table columns:</p>
<ul>
<li>The <b>% Load</b> column indicates what percentage of the CPU load was
@@ -58,6 +71,16 @@
to display a context menu of various options. The color next to a checkbox
corresponds to that item’s color in the graph.</p>
+<h4>Scaling the Graph and Table According to CPU Clock Speed</h4>
+
+<p>When CPU clock rate counter is included in the sampled Performance Counter
+data, there is a <strong>Scale to CPU Clock Speed</strong> option available in
+the graph context menu. When the option is selected, both the graph and the
+<strong>% Load</strong> column of the legend table are scaled according to the
+CPU clock speed. </p>
+
+<h3>CPU Thread Load graphs in SMP systems</h3>
+
<p>For SMP systems with more than one CPU it is also possible to select to</p>
<ul>
<li><b>Show Combined CPU Graph</b>, that is, to view all CPUs merged into one
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/troubleshooting.htm Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,116 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <title>Troubleshooting</title>
+ <link rel="StyleSheet"
+ href="../../../../../../ProfilerActivator/trunk/com.nokia.s60tools.profileractivator.help/book.css"
+ type="text/css">
+</head>
+
+<body>
+<h2>Troubleshooting</h2>
+
+<p>Below are listed the error messages and resolutions for problems with the PI
+Import wizard during file import.</p>
+
+<table border="1" cellspacing="1" cellpadding="2">
+ <colgroup><col width="250*">
+ <col width="356*">
+ </colgroup>
+ <tbody>
+ <tr>
+ <th>Message</th>
+ <th align="center">Resolution</th>
+ </tr>
+ <tr>
+ <td>Unable to resolve current connection. Please check your connection
+ settings.</td>
+ <td>This message usually appears when you select to get profiler files
+ form device via TraceViewer for the first time, and the connections
+ settings have not yet defined.
+
+ <p>To resolve the problem, click <strong>Connection
+ Settings...</strong> to open the dialog where you can select the
+ correct settings for the connection you want to use. After saving the
+ settings, click Refresh Plug-ins List and continue with tracing. For
+ more specific instructions, see <a
+ href="../../tasks/analyser/an_load_trace_files.htm">Importing Profiler
+ Data files</a>.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>Could not read available plug-ins from device. See Troubleshooting
+ topic from Help.</td>
+ <td><p>This message appears when the connection settings have been
+ defined, but the information for the plug-in list cannot be fetched.</p>
+
+ <p>To resolve the problem, test that the Tracing service connection is
+ working:</p>
+ <ol>
+ <li>Click <strong>Connection Settings... </strong></li>
+ <li>Select the connection you are using and click
+ <strong>Edit...</strong></li>
+ <li>Select the <strong>Test Connection</strong> tab</li>
+ <li>Select the Device OS</li>
+ <li>Select Tracing as the service to test</li>
+ <li>Click <strong>Initiate Service Testing</strong>.</li>
+ </ol>
+
+ <p>If the connection works, but you still get the error message, makes
+ sure that PI Profiler is installed on the device.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>Received corrupted data! See Troubleshooting topic from Help
+
+ <p></p>
+ </td>
+ <td>This message appears when try to use a USB connections for profiling
+ several plugins, and the connection cannot handle the amount of data.
+
+ <p>To resolve the problem, try profiling fewer plugins; or, if you need
+ to profile several plugins in the same trace, change to TCP/IP Musti
+ connection. For more specific instructions, see <a
+ href="../../tasks/analyser/an_load_trace_files.htm">Importing Profiler
+ Data files</a>.</p>
+ </td>
+ </tr>
+ <tr>
+ <td>Multiple problems have occurred. Jave heap space.</td>
+ <td>This message can appear when you try to import a large profiler date
+ file.
+
+ <p>Although Carbide.c++ reserves a large block of memory for the Java
+ Virtual Machine (JVM) to run the whole IDE, in some cases, the trace
+ import process may fail due to out-of-memory situation. This is usually
+ due to the Profiler trace log being too long in time and/or CPU load
+ being extensively high over the use case. The out-of-menory may also
+ lead to instability issues with Carbide itself, in which case the error
+ is shown.</p>
+
+ <p>This problem can be avoided by keeping the profiled use cases
+ shorter (the recommendation is maximum 5 minutes), and by selecting
+ only those Profiler plug-ins that are needed for analysing the use
+ case. Shorter use cases (in time) and smaller amount of selected
+ profiler plug-ins also ease up the analysis phase, since it is easier
+ to a browse shorter set of data and to pinpoint the possible
+ performance issues within the trace.</p>
+
+ <p>If you need to analyse longer use cases, there are also other tools
+ available for long-period-testing (LPT). For example, you can run the
+ Nokia Energy Profiler (NEP) directly on target and it can be used for
+ LPT type of use cases.</p>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<p></p>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved.</div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/view_CPU.htm Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,42 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>CPU Views</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>CPU Views</h2>
+
+<p>To view different CPU related date, you can select <a
+href="thread_load.htm">Thread Load</a>, <a href="binary_load.htm">Binary
+Load</a>, <a href="function_load.htm">Function Load</a>, or <a
+href="function_calls.htm">Function Calls</a> by selecting the respective tabs
+at the bottom of the main view, as shown in Figure 1. below.</p>
+
+<p></p>
+
+<p align="center"><img src="images/analz_loads_tabs.png" width="423"
+height="84"></p>
+
+<p align="center" class="figure">Figure 1. Selecting Threads, Binaries,
+Functions, or Function Calls</p>
+
+<p><strong>Related references</strong></p>
+<ul>
+ <li><a href="thread_load.htm">Thread Load</a></li>
+ <li><a href="binary_load.htm">Binary Load</a></li>
+ <li><a href="function_load.htm">Function Load</a></li>
+ <li><a href="function_calls.htm">Function Calls</a></li>
+ <li><a href="GUI_tour.htm">Analyzer GUI Controls </a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/view_graphics_memory_usage.htm Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,106 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Graphics Memory Usage View</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Graphics Memory Usage View</h2>
+
+<p>Use the <strong>Graphics Memory Usage</strong> view to display the private,
+shared, or total graphics memory usage of processes running on a device. The
+graph portion of the Graphics Memory Usage view shows the amount of graphics
+memory used by the processes, and, if selected, the total amount of graphics
+memory used at the time intervals selected for the GPU sampler in PI Profiler.
+A list of processes appears at the bottom of the view showing the private,
+shared and total memory usage for each process.</p>
+
+<p>Data in the Graphics Memory Usage view is layered with the shared memory
+usage data overlaying the private memory usage data. Private memory usage is
+represented by light blue color, while shared memory usage is represented by
+light green. You can select to view either private or shared graphics memory
+usage, or both of them combined, by using the view options available in the
+Title bar drop-down menu, shown in Figure 1, or in the
+<strong>Investigator</strong> > <a
+href="menu_graphics_memory_graph.htm">Graphics Memory Graph Menu</a> . </p>
+
+<p align="center"><img src="images/graphics_memory_graph_drop_down.png"></p>
+
+<p class="figure">Figure 1. Graphics Memory Usage Title bar drop-down menu</p>
+
+<p>According to the selection, the graph displays the following (Figure 2):</p>
+<ul>
+ <li>Private Usage — light blue box only</li>
+ <li>Shared Usage — light green box only </li>
+ <li>Private and Shared Usage (Figure 2) — light blue box (private memory
+ usage) and a light green line (shared memory usage) </li>
+</ul>
+
+<p>Additionally, a black line indicating the total graphics memory usage is
+available. The line is always displayed by default, but you can choose to hide
+or show the line by either right-clicking on the graph and selecting
+<strong>Show Total Graphics Memory Usage</strong>, or by selecting
+<strong>Investigator</strong> -> <strong>Graphics Memory Graph</strong>
+-> <strong>Show Total Graphics Memory Usage</strong>. </p>
+
+<p class="note">NOTE The difference between the cumulative (combined shared and
+private usage) and total memory consumption (provided by the internal API) is
+explained by the graphic acceleration system component itself: it cannot be
+tracked by the GPU sampler of PI Profiler and therefore it is not visible in
+the cumulative graph. In addition, if some graphics memory has been reserved
+bypassing the graphic accelerator, for example using ARM interfaces (e.g.
+camera application), the difference is even bigger. </p>
+
+<p>You can also move the mouse pointer on top of the graph to see the amount of
+graphics memory used at that time as a tooltip, as shown in Figure 2 below.</p>
+
+<p align="center"><img src="images/view_graphics_memory_usage.png"></p>
+
+<p class="figure">Figure 2. Graphics Memory Usage graph and thread list </p>
+
+<p>Description of table columns (Figure 2):</p>
+<ul>
+ <li>The <b>Process</b> column lists the processes using graphics memory.</li>
+ <li>The <b>Private</b> column displays the amount of private graphics memory
+ used by each process for the selected time period (selection area on the
+ graph).</li>
+ <li>The <b>Shared</b> column displays the amount of shared memory used by the
+ process for the selected time period (selection area on the graph)</li>
+ <li>The <b>Memory Total</b> column displays the sum of the private and shared
+ graphics memory usage for the selected time period (selection area on the
+ graph).</li>
+</ul>
+
+<p>Columns may be reordered, resized, and sorted by clicking or dragging column
+headers.</p>
+
+<p>Information on the graphics memory usage is also available in a separate <a
+href="wnd_graphics_memory_usage_statistics.htm">Graphics Memory Usage
+Statistics</a> dialog. You can open the dialog from the <a
+href="context_menu.htm">context menu</a> by right-clicking on the Graphics
+Memory Usage graph and selecting <a
+href="wnd_graphics_memory_usage_statistics.htm">Graphics Memory Usage
+Statistics</a>; or by selecting <strong>Investigator</strong> ->
+<strong>Graphics Memory Graph</strong> -> <strong><strong>Graphics Memory
+Usage Statistics</strong>.</strong></p>
+
+<p><strong>Related references </strong></p>
+<ul>
+ <li><a href="main_view.htm">Analyzer View</a></li>
+ <li><a href="menu_graphics_memory_graph.htm">Graphics Memory Graph Menu
+ </a></li>
+ <li><a href="wnd_graphics_memory_usage_statistics.htm">Graphics Memory Usage
+ Statistics</a> </li>
+ <li><a href="context_menu.htm">Context Menu Options</a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/view_performance_counters.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/view_performance_counters.htm Wed Jun 23 15:05:09 2010 +0300
@@ -88,34 +88,10 @@
<p><strong>MIPS counter and graph</strong></p>
<p>The Million Instructions Per Second (MIPS) graph gives you a general idea of
-CPU speed in a measured use case. The basic use case for the MIPS analysis
-would be to check any low areas in the graph since they may reveal unoptimized
-features, for example, in terms of memory access (reads and writes). The higher
-the MIPS values, the better and the faster the CPU is in executing
-instructions.</p>
-
-<p>A MIPS (Million Instructions Per Millisecond) graph is displayed in the
-Performance Counters view, when <b>Instructions executed</b> has been selected
-as one of the counters. If <b>Instructions executed</b> has been selected, the
-dialog below is displayed during PIAnalyser file import:</p>
-
-<p align="center"><img src="images/MIPS_speed_dialog.png"></p>
+CPU speed in a measured use case. For more information, see <a
+href="MIPS_counter_graph.htm">MIPS Counter and Graph</a>.</p>
-<p class="figure">Figure 1. MIPS Graph Generation</p>
-
-<p>The processor speed information is needed for calculating the data for the
-MIPS graph. The rest of the data for the calculation is included in the
-<b>Instructions executed</b> and <b>CPU cycles</b> counters.</p>
-
-<p>The MIPS counter information is displayed in the graphs view and the legend
-table together with the other performance counters. Note, however, that for
-MIPS only <b>Average (1/ms)</b>, <b>Min (1/ms)</b>, and <b>Max (1/ms)</b>
-information is displayed in the legend table.</p>
-
-<p><br>
-</p>
-
-<p><strong>Related references </strong></p>
+<h4>Related references </h4>
<ul>
<li><a href="../../reference/analyzer/traceable_events.htm">Traceable Event
Types</a></li>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/view_power_usage.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/view_power_usage.htm Wed Jun 23 15:05:09 2010 +0300
@@ -36,9 +36,10 @@
<p><strong>Related references </strong></p>
<ul>
- <li><a href="main_view.htm">Analyzer View</a></li>
<li><a href="menu_power_graph.htm">Power Graph Menu </a></li>
<li><a href="wnd_power_usage_statistics.htm">Power Usage Statistics</a> </li>
+ <li><a href="wnd_power_graph_settings.htm">Power Usage Settings</a></li>
+ <li><a href="main_view.htm">Analyzer View</a></li>
</ul>
<div id="footer">
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/wnd_graphics_memory_usage_statistics.htm Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Graphics Memory Usage Statistics</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Graphics Memory Usage Statistics</h2>
+
+<p>Use the <strong>Graphics Memory Usage Statistics</strong> dialog to view
+details on the graphics memory usage. These values are displayed for the
+selected time interval as follows:</p>
+<ul>
+ <li>Interval selected in the Graphics Memory Usage view graph</li>
+ <li>The Used, Free, and Total graphics memory on the device</li>
+ <li>The total graphics memory allocated to all processes in the selected time
+ interval </li>
+</ul>
+
+<p align="center"><img src="images/graphics_memory_usage_stats.png"></p>
+
+<p class="figure">Figure 1. Graphics Memory Usage Statistics dialog</p>
+
+<p>Â </p>
+
+<p><strong>Related references </strong></p>
+<ul>
+ <li><a href="view_graphics_memory_usage.htm">Graphics Memory Usage
+ View</a></li>
+ <li><a href="main_view.htm">Analyzer View</a></li>
+ <li><a href="menu_graphics_memory_graph.htm">Graphics Memory Graph Menu
+ </a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/wnd_memory_usage_statistics.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/wnd_memory_usage_statistics.htm Wed Jun 23 15:05:09 2010 +0300
@@ -1,27 +1,43 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Memory Usage Statistics</title>
- <link href="../../../book.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
-<h2>Memory Usage Statistics</h2>
-<p>Use the <strong>Memory Usage Statistics</strong> dialog to view the on-device and memory usage. These values are displayed for the selected time interval as follows:</p>
-<ul><li>Interval selected in the memory usage view</li>
- <li>The Used, Free, and Total memory on the device</li>
- <li>The total memory allocated to all chunks, stacks, heaps, and other code in RAM in the selected time interval </li>
-</ul>
-<p align="center"><img src="images/wnd_memory_usage_stats.png" width="270" height="269"></p>
-<p class="figure">Figure 1. Memory Usage Statistics dialog</p>
-<p> </p>
-<p><strong>Related references </strong></p>
-<ul>
- <li><a href="main_view.htm">Analyzer View</a></li>
-<li><a href="menu_memory_graph.htm">Memory Graph Menu </a></li>
-</ul>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Memory Usage Statistics</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Memory Usage Statistics</h2>
+
+<p>Use the <strong>Memory Usage Statistics</strong> dialog to view the
+on-device and memory usage. These values are displayed for the selected time
+interval as follows:</p>
+<ul>
+ <li>Interval selected in the memory usage view</li>
+ <li>The Used, Free, and Total memory on the device</li>
+ <li>The total memory allocated to all chunks, stacks, heaps, and other code
+ in RAM in the selected time interval </li>
+</ul>
+
+<p align="center"><img src="images/wnd_memory_usage_stats.png" width="270"
+height="269"></p>
+
+<p class="figure">Figure 1. Memory Usage Statistics dialog</p>
+
+<p>Â </p>
+
+<p><strong>Related references </strong></p>
+<ul>
+ <li><a href="view_memory_usage.htm">Memory Usage View</a></li>
+ <li><a href="menu_memory_graph.htm">Memory Graph Menu </a></li>
+ <li><a href="main_view.htm">Analyzer View</a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/wnd_power_graph_settings.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/wnd_power_graph_settings.htm Wed Jun 23 15:05:09 2010 +0300
@@ -1,27 +1,45 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Power Usage Settings</title>
- <link href="../../../book.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
-<h2>Power Usage Settings</h2>
-<p>Use the <b>Power Usage Settings</b> dialog to to change the voltage and battery capacity. The Power Usage Settings dialog enables:</p>
-<ul>
- <li>Setting the Voltage value using an integer or floating point number that represents <a href="http://en.wikipedia.org/wiki/Volt">volts</a> (V) and rounded to the neareth 100th of a volt </li>
-<li>Setting the Battery capacity to an integer that represents battery capacity in <a href="http://en.wikipedia.org/wiki/Ampere">milliamperes</a> (mAh)</li>
-</ul>
-<p>The power usage graph is redrawn and any statistics displayed are updated as needed.</p>
-<p align="center"><img src="images/wnd_power_usage_settings.png" width="198" height="132"></p>
-<p class="figure">Figure 1. Power Usage Settings dialog</p>
-<p><strong>Related references </strong></p>
-<ul>
- <li><a href="main_view.htm">Analyzer View</a></li>
-<li><a href="menu_power_graph.htm">Power Graph Menu </a></li>
-</ul>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Power Usage Settings</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Power Usage Settings</h2>
+
+<p>Use the <b>Power Usage Settings</b> dialog to to change the voltage and
+battery capacity. The Power Usage Settings dialog enables:</p>
+<ul>
+ <li>Setting the Voltage value using an integer or floating point number that
+ represents <a href="http://en.wikipedia.org/wiki/Volt">volts</a> (V) and
+ rounded to the neareth 100th of a volt </li>
+ <li>Setting the Battery capacity to an integer that represents battery
+ capacity in <a href="http://en.wikipedia.org/wiki/Ampere">milliamperes</a>
+ (mAh)</li>
+</ul>
+
+<p>The power usage graph is redrawn and any statistics displayed are updated as
+needed.</p>
+
+<p align="center"><img src="images/wnd_power_usage_settings.png" width="198"
+height="132"></p>
+
+<p class="figure">Figure 1. Power Usage Settings dialog</p>
+
+<p><strong>Related references </strong></p>
+<ul>
+ <li><a href="view_power_usage.htm">Power Usage View</a></li>
+ <li><a href="menu_power_graph.htm">Power Graph Menu </a></li>
+ <li><a href="main_view.htm">Analyzer View</a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/wnd_power_usage_statistics.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/analyzer/wnd_power_usage_statistics.htm Wed Jun 23 15:05:09 2010 +0300
@@ -1,31 +1,53 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Power Usage Statistics</title>
- <link href="../../../book.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
-<h2>Power Usage Statistics</h2>
-<p>Use the <strong>Power Usage Statistics</strong> dialog to view the average power, estimated power, estimated battery life, as well as maximum and minimum power requirements, and variance for the selected interval. These values are displayed as follows: </p>
-<ul>
- <li>Interval selected in the power usage view</li>
- <li>Total battery current in <a href="http://en.wikipedia.org/wiki/Milliamp">milliamp</a> (mAh) and <a href="http://en.wikipedia.org/wiki/Voltage">voltage</a> (V) </li>
- <li>Estimated energy is displayed in <a href="http://en.wikipedia.org/wiki/Joule">millijoules</a> (mJ)</li>
- <li>Estimated battery life in hours (h) and minutes (m) </li>
- <li>Average power is displayed in <a href="http://en.wikipedia.org/wiki/Watt">milliwatts</a> (mW), to the nearest tenth</li>
- <li>Minimum to maximum power are displayed in <a href="http://en.wikipedia.org/wiki/Watt">milliwatts</a> (mW), to the nearest tenth</li>
- <li><a href="http://en.wikipedia.org/wiki/Variance">Variance</a> is displayed in milliwatts squared (mW*mW), to the nearest tenth</li>
-</ul>
-<p align="center"><img src="images/wnd_power_usage_stats.png" width="233" height="429"></p>
-<p class="figure">Figure 1. Power Usage Statistics dialog</p>
-<p><strong>Related references </strong></p>
-<ul>
- <li><a href="main_view.htm">Analyzer View</a></li>
-<li><a href="menu_power_graph.htm">Power Graph Menu </a></li>
-</ul>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Power Usage Statistics</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Power Usage Statistics</h2>
+
+<p>Use the <strong>Power Usage Statistics</strong> dialog to view the average
+power, estimated power, estimated battery life, as well as maximum and minimum
+power requirements, and variance for the selected interval. These values are
+displayed as follows: </p>
+<ul>
+ <li>Interval selected in the power usage view</li>
+ <li>Total battery current in <a
+ href="http://en.wikipedia.org/wiki/Milliamp">milliamp</a> (mAh) and <a
+ href="http://en.wikipedia.org/wiki/Voltage">voltage</a> (V) </li>
+ <li>Estimated energy is displayed in <a
+ href="http://en.wikipedia.org/wiki/Joule">millijoules</a> (mJ)</li>
+ <li>Estimated battery life in hours (h) and minutes (m) </li>
+ <li>Average power is displayed in <a
+ href="http://en.wikipedia.org/wiki/Watt">milliwatts</a> (mW), to the
+ nearest tenth</li>
+ <li>Minimum to maximum power are displayed in <a
+ href="http://en.wikipedia.org/wiki/Watt">milliwatts</a> (mW), to the
+ nearest tenth</li>
+ <li><a href="http://en.wikipedia.org/wiki/Variance">Variance</a> is displayed
+ in milliwatts squared (mW*mW), to the nearest tenth</li>
+</ul>
+
+<p align="center"><img src="images/wnd_power_usage_stats.png" width="233"
+height="429"></p>
+
+<p class="figure">Figure 1. Power Usage Statistics dialog</p>
+
+<p><strong>Related references </strong></p>
+<ul>
+ <li><a href="view_power_usage.htm">Power Usage View</a></li>
+ <li><a href="menu_power_graph.htm">Power Graph Menu </a></li>
+ <li><a href="main_view.htm">Analyzer View</a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/advanced_options.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/advanced_options.htm Wed Jun 23 15:05:09 2010 +0300
@@ -1,88 +1,115 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Setting Advanced Options</title>
- <link href="../../../book.css" rel="stylesheet" type="text/css">
- <style type="text/css">
-<!--
-.style1 { color: #FF0000;
- font-weight: bold;
-}
-.style2 {font-family: Georgia, "Times New Roman", Times, serif}
--->
- </style>
-</head>
-
-<body>
-<h2>Setting Advanced Options </h2>
-<p>Use the <b>Advanced</b> options menu in the Profiler to specify the thread priority sample interval. The advanced options include:</p>
-<ul>
- <li>Memory/Priority Sample interval</li>
- <li>Power Usage interval</li>
- <li>Address/Thread interval</li>
-</ul>
-<p class="note"><span class="style1">WARNING</span> When you enable all the traces, the 50ms minimum Memory/Priority interval may not be sufficient for all of the traces to complete successfully between each cycle. This can cause strange errors, such as loss of icons in lists. If you suspect this problem, simply increase the sampling interval to 100ms or more or disable some traces.</p>
-<table width="600" border="1" align="center">
- <tr align="center">
- <td><b>S60</b></td>
- <td><b>UIQ</b></td>
- </tr>
- <tr align="center">
- <td width="50%"><div align="center"><img src="images/TracingOptionsList3.png" width="240" height="320"></div></td>
- <td><div align="center"><img src="images/uiq_setting_advanced_settings.png" width="240" height="320"></div></td>
- </tr>
-</table>
-<p class="figure">Figure 1. Advanced options settings in Profiler (S60 and UIQ) </p>
-<h5>Table 1. Advanced Options</h5>
-<table width="90%" border="0" cellpadding="2" cellspacing="0">
- <tr>
- <th width="213" scope="col">Menu Option </th>
- <th width="646" scope="col">Description</th>
- </tr>
- <tr>
- <td><b>Memory/Priority Sample interval </b></td>
- <td><p>Specify the memory and thread priority sample interval.</p>
- <p>The operating system is called automatically every millisecond to determine what thread is currently executing. This interval setting indicates how often an additional query to the operating system is made to determine the priority of the currently executing thread. </p>
- <p>The interval is specified in milliseconds. The minimum interval for sampling is 50ms, with the default setting 1000ms. </p>
- <p class="note"><b>NOTE</b> See<a href="output_settings.htm"> Setting Output Settings</a> for UIQ File prefix information. </p></td>
- </tr>
- <tr>
- <td><b>Power Usage Interval </b></td>
- <td><p>Specify the power usage priority sample interval.</p>
- <p>The interval is specified in milliseconds. The minimum interval for sampling is 50ms (20Hz), with the default setting 250ms (4Hz). The minimum interval at which sampled power values change is device dependent. </p>
- <p class="note"><b>NOTE</b> Power usage measurements are not available in UIQ version. </p>
- <p class="note style2"><span class="note"><b>NOTE</b></span> If you install a 3.1 0r 3.2 SIZE SISX file, the power usage sampling time interval will always be 250 ms, regardless of what value you specify.</p></td>
- </tr>
- <tr>
- <td><strong>Address/Thread interval</strong> </td>
- <td>Specify the Address/Thread interval. Enter an address/thread sampling interval between 1ms and 10000ms (10 seconds).</td>
- </tr>
-</table>
-<div>
- <h4>Setting an Advanced Option</h4>
- <ol>
- <li>Launch the Profiler application on the target device </li>
- <li>Open the Output Settings options screen: </li>
- <ul>
- <li>S60 - Select the Output Settings menu</li>
- <li>UIQ - Select the Misc Settings... menu</li>
- </ul>
- <li>Set the desired option on or off</li>
- <li>Exit the screen </li>
- </ol>
-</div>
- <h5>Related references</h5>
-<ul>
- <li><a href="prof_using.htm">Using the Profiler</a>
-</li>
-</ul>
-<h5>Related tasks</h5>
-<ul>
- <li><a href="tracing_options.htm">Setting Tracing Options</a></li>
-<li><a href="output_settings.htm">Setting Output Settings </a> </li>
-</ul>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Setting Advanced Options</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+ <style type="text/css">
+<!--
+ .style1 { color: #FF0000;
+font-weight: bold;
+}
+ .style2 {font-family: Georgia, "Times New Roman", Times, serif}
+-->
+
+ </style>
+</head>
+
+<body>
+<h2>Setting Advanced Options </h2>
+
+<p>Use the <b>Advanced</b> options menu in the Profiler to specify the thread
+priority sample interval. The advanced options include:</p>
+<ul>
+ <li>Memory/Priority Sample interval</li>
+ <li>Power Usage interval</li>
+ <li>Address/Thread interval</li>
+</ul>
+
+<p class="note"><span class="style1">WARNING</span> When you enable all the
+traces, the 50ms minimum Memory/Priority interval may not be sufficient for all
+of the traces to complete successfully between each cycle. This can cause
+strange errors, such as loss of icons in lists. If you suspect this problem,
+simply increase the sampling interval to 100ms or more or disable some
+traces.</p>
+
+<p align="center"><img src="images/TracingOptionsList3.png"></p>
+
+<p class="figure">Figure 1. Advanced options settings in Profiler (S60) </p>
+
+<h5>Table 1. Advanced Options</h5>
+
+<table width="90%" border="0" cellpadding="2" cellspacing="0">
+ <tbody>
+ <tr>
+ <th width="213" scope="col">Menu Option </th>
+ <th width="646" scope="col">Description</th>
+ </tr>
+ <tr>
+ <td><b>Memory/Priority Sample interval </b></td>
+ <td><p>Specify the memory and thread priority sample interval.</p>
+
+ <p>The operating system is called automatically every millisecond to
+ determine what thread is currently executing. This interval setting
+ indicates how often an additional query to the operating system is made
+ to determine the priority of the currently executing thread. </p>
+
+ <p>The interval is specified in milliseconds. The minimum interval for
+ sampling is 50ms, with the default setting 1000ms. </p>
+ </td>
+ </tr>
+ <tr>
+ <td><b>Power Usage Interval </b></td>
+ <td><p>Specify the power usage priority sample interval.</p>
+
+ <p>The interval is specified in milliseconds. The minimum interval for
+ sampling is 50ms (20Hz), with the default setting 250ms (4Hz). The
+ minimum interval at which sampled power values change is device
+ dependent. </p>
+
+ <p class="note style2"><span class="note"><b>NOTE</b></span> If you
+ install a 3.1 0r 3.2 SIZE SISX file, the power usage sampling time
+ interval will always be 250 ms, regardless of what value you
+ specify.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong>Address/Thread interval</strong> </td>
+ <td>Specify the Address/Thread interval. Enter an address/thread sampling
+ interval between 1ms and 10000ms (10 seconds).</td>
+ </tr>
+ </tbody>
+</table>
+
+<div>
+<h4>Setting an Advanced Option</h4>
+<ol>
+ <li>Launch the Profiler application on the target device </li>
+ <li>Open the Output Settings options screen: </li>
+</ol>
+<ul>
+ <li>S60 - Select the Output Settings menu</li>
+ <li>Set the desired option on or off</li>
+ <li>Exit the screen </li>
+</ul>
+</div>
+
+<h5>Related references</h5>
+<ul>
+ <li><a href="prof_using.htm">Using the Profiler</a> </li>
+</ul>
+
+<h5>Related tasks</h5>
+<ul>
+ <li><a href="tracing_options.htm">Setting Tracing Options</a></li>
+ <li><a href="output_settings.htm">Setting Output Settings </a> </li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/images/gpp_bargraph.png has changed
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/output_settings.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/output_settings.htm Wed Jun 23 15:05:09 2010 +0300
@@ -1,76 +1,95 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Setting Output Settings</title>
- <link href="../../../book.css" rel="stylesheet" type="text/css">
- <style type="text/css">
-<!--
-.style1 {font-family: "Courier New", Courier, mono}
--->
- </style>
-</head>
-
-<body>
-<h2>Setting Output Settings</h2>
-<p>Use the <b>Output settings </b> menu in the Profiler to specify the characteristics of the sampled data file. The output settings include:</p>
-<table width="650" border="1" align="center">
- <tr>
- <td width="33"><b>S60</b></td>
- <td width="593"><div align="center"> <img src="images/screen_output_settings.png" width="264" height="312"> <img src="images/screen_output_settings_02.png" width="264" height="312"></div></td>
- </tr>
- <tr>
- <td><b>UIQ</b></td>
- <td><div align="center"><img src="images/uiq_setting_output_settings.png" width="240" height="320"></div></td>
- </tr>
-</table>
-<p class="figure">Figure 1. Output Settings options for file system and debug mode (S60 and UIQ) </p>
-<h5>Table 1. Output Settings Options</h5>
-<table width="90%" border="0" cellpadding="2" cellspacing="0">
- <tr>
- <th width="147" scope="col">Menu Option </th>
- <th width="640" scope="col">Description</th>
- </tr>
- <tr>
- <td><b>Output to </b></td>
- <td><p>Specify either the target device's <span class="style1">File system</span> or <span class="style1">Debug port</span> to store the sampled data.</p>
- <p class="note"><b>NOTE </b>Not available in UIQ version. </span></p></td>
- </tr>
- <tr>
- <td><b>Save file in </b></td>
- <td>If you selected <span class="style1">File system</span> in the <span class="style1">Output to</span> menu option, then you can save the data file to a memory card or the target device's C:\ drive.
- <p class="note"><b>NOTE</b> Not available in UIQ version. </span></p></td>
- </tr>
- <tr>
- <td><b>File prefix </b></td>
- <td><p>Specify the file prefix for data files. The name of the profiler data file is formed from the prefix and ends with a .dat extension. If you perform multiple traces and use the file output option, include a hash mark (#) in your file prefix. Subsequent traces will then be saved with different file names. The hash mark will be replaced with an incremented number starting from one.</p>
- <p><span class="note">Files names must be 19 characters or less.</span></p>
- <p class="note"><b>NOTE</b> See<a href="advanced_options.htm"> Setting Advanced Options</a> for UIQ Mem, Pri sample interval information. </p></td>
- </tr>
-</table>
-<div>
- <h4>Setting the Output Settings </h4>
- <ol>
- <li>Launch the Profiler application on the target device </li>
- <li>Open the Output Settings options screen: </li>
- <ul>
- <li>S60 - Select the Output Settings menu</li>
- <li>UIQ - Select the Misc Settings... menu</li>
- </ul>
- <li>Set the sampled data file informaton</li>
- <li>Exit the screen </li>
- </ol>
-</div>
-<h5>Related references</h5>
-<ul>
- <li><a href="prof_using.htm">Using the Profiler</a></li>
-</ul>
-<h5>Related tasks</h5>
-<ul>
- <li><a href="advanced_options.htm">Setting Advanced Options</a></li>
- <li><a href="tracing_options.htm">Setting Tracing Options</a></li>
-</ul>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Setting Output Settings</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+ <style type="text/css">
+<!--
+ .style1 {font-family: "Courier New", Courier, mono}
+-->
+
+ </style>
+</head>
+
+<body>
+<h2>Setting Output Settings</h2>
+
+<p>Use the <b>Output settings </b> menu in the Profiler to specify the
+characteristics of the sampled data file. The output settings include:</p>
+
+<p align="center">Â <img src="images/screen_output_settings.png">Â <img
+src="images/screen_output_settings_02.png"></p>
+
+<p class="figure">Figure 1. Output Settings options for file system and debug
+mode (S60) </p>
+
+<h5>Table 1. Output Settings Options</h5>
+
+<table width="90%" border="0" cellpadding="2" cellspacing="0">
+ <tbody>
+ <tr>
+ <th width="147" scope="col">Menu Option </th>
+ <th width="640" scope="col">Description</th>
+ </tr>
+ <tr>
+ <td><b>Output to </b></td>
+ <td><p>Specify either the target device's <span class="style1">File
+ system</span> or <span class="style1">Debug port</span> to store the
+ sampled data.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><b>Save file in </b></td>
+ <td>If you selected <span class="style1">File system</span> in the <span
+ class="style1">Output to</span> menu option, then you can save the data
+ file to a memory card or the target device's C:\ drive. </td>
+ </tr>
+ <tr>
+ <td><b>File prefix </b></td>
+ <td><p>Specify the file prefix for data files. The name of the profiler
+ data file is formed from the prefix and ends with a .dat extension. If
+ you perform multiple traces and use the file output option, include a
+ hash mark (#) in your file prefix. Subsequent traces will then be saved
+ with different file names. The hash mark will be replaced with an
+ incremented number starting from one.</p>
+
+ <p><span class="note">Files names must be 19 characters or
+ less.</span></p>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<div>
+<h4>Setting the Output Settings </h4>
+<ol>
+ <li>Launch the Profiler application on the target device </li>
+ <li>Open the Output Settings options screen: </li>
+</ol>
+<ul>
+ <li>S60 - Select the Output Settings menu</li>
+ <li>Set the sampled data file informaton</li>
+ <li>Exit the screen </li>
+</ul>
+</div>
+
+<h5>Related references</h5>
+<ul>
+ <li><a href="prof_using.htm">Using the Profiler</a></li>
+</ul>
+
+<h5>Related tasks</h5>
+<ul>
+ <li><a href="advanced_options.htm">Setting Advanced Options</a></li>
+ <li><a href="tracing_options.htm">Setting Tracing Options</a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/prof_using.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/prof_using.htm Wed Jun 23 15:05:09 2010 +0300
@@ -1,125 +1,179 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Using the Profiler</title>
- <link href="../../../book.css" rel="stylesheet" type="text/css">
- <style type="text/css">
-<!--
-.style1 {font-family: "Courier New", Courier, mono}
--->
- </style>
-</head>
-
-<body>
-<h2>Using the Profiler</h2>
-<h4>Overview</h4>
-<p>After successfully <a href="../../tasks/profiler/prof_installation.htm">installing</a> the Profiler .SISX file on your target device, you will be able to access the user interface. Run the <b>CarbidePI</b> application located in the “Installed” applications (Figure 1).</p>
-<table width="600" border="1" align="center">
- <tr align="center">
- <td><b>S60</b></td>
- <td><b>UIQ</b></td>
- </tr>
- <tr align="center">
- <td width="50%"><div align="center"><img src="../profiler/images/SamplingProfilerMainWindow.png" width="264" height="312"></div></td>
- <td><div align="center"><img src="images/uiq_using_the_profiler.png" width="240" height="320"></div></td>
- </tr>
-</table>
-<p align="center" class="figure">Figure 1 - Profiler Main Window (S60 and UIQ) </p>
-<p>In Options, configure the necessary run-time options. Specify which traces you want enabled, where to place the generated .dat profiler data file, the profiler file prefix, and the trace priority sampling interval.</p>
-<p>In the Profiler, the Address/Thread trace is <strong>always</strong> active when profiling is performed. Other traces are synchronized with the Address/Thread trace.</p>
-<p>In addition to Address/Thread trace, you can enable additional trace options such as dynamic binary support, memory and power usage, and function calls.</p>
-<div class="step">
- <h4>Profiling an Application</h4>
- <ol>
- <li>Open the Profiler options screen
- <p>Select the Tracing options menu from the Profiler menu (Figure 2)</p>
- </li>
- <blockquote>
- <table width="600" border="1" align="center">
- <tr align="center">
- <td><b>S60</b></td>
- <td><b>UIQ</b></td>
- </tr>
- <tr align="center">
- <td width="50%"><div align="center"><img src="../profiler/images/TracingOptions.png" width="264" height="312"></div></td>
- <td><div align="center"><img src="images/TracingOptions_uiq.png" width="240" height="320"></div></td>
- </tr>
- </table>
- </blockquote>
- <blockquote>
- <p align="center" class="figure">Figure 2 - Tracing Options</p>
- </blockquote>
- <li>Enable or disable trace options</li>
-
- <p>Specify On or Off for the available trace items - Dynamic binary support, Function call capture, and Thread priority capture. (Figure 3).</p>
- <blockquote>
- <p align="left" class="note"><b>NOTE</b> If the executables you wish to analyze are not in a ROM image (.symbol file) of your target device, then you will need to turn on Dynamic binary support.</p>
- </blockquote>
- <table width="600" border="1" align="center">
- <tr align="center">
- <td><b>S60</b></td>
- <td><b>UIQ</b></td>
- </tr>
- <tr align="center">
- <td width="50%"><div align="center"><img src="../profiler/images/TracingOptionsList.png" width="264" height="312"><img src="images/TracingOptionsList2.png" width="264" height="312"></div></td>
- <td><div align="center"><img src="images/uiq_setting_tracing_options.png" width="240" height="320"></div></td>
- </tr>
- </table>
- <p align="center" class="figure">Figure 3 - List of Trace Items</p>
- <li>Specify Output</li>
- <p>Specify the output for the sampled data (Figure 4). The output method can be either the <span class="style1">File system</span> or <span class="style1">Debug port</span>. If you select File system, you can save the data file to a memory card or the target device C:\ drive. With the debug port output method, you will need hardware (such as the Nokia Musti box) connected to the XTI/STI debug port to capture the profiler data. There is less profiler overhead if the debug port is used.</p>
- <table width="600" border="1" align="center">
- <tr align="center">
- <td><b>S60</b></td>
- <td><b>UIQ</b></td>
- </tr>
- <tr align="center">
- <td width="50%"><div align="center"><img src="../profiler/images/OutputOptionsWindow_FileSystem.png" width="264" height="312"></div></td>
- <td><div align="center"><img src="images/uiq_setting_output_settings.png" width="240" height="320"></div></td>
- </tr>
- </table>
- <p align="center" class="figure">Figure 4 - Output Options</p>
- <p>You can specify the file prefix for data files. The name of the profiler data file is formed from the prefix plus stream.dat. If you perform multiple traces and use the file output option, include a hash mark (#) in your file prefix. Subsequent traces will then be saved with different file names. The hash mark is automatically replaced with a number. For example, if you define the file prefix as <span class="style1">PI_#_</span>, multiple trace files will be named <span class="style1">PI_1_STREAM.dat, PI_2_STREAM.dat, … PI_100_STREAM.dat</span>. Only one hash mark is needed to provide sequential numbering.
- If no hash mark is present, the same file will be overwritten with the same name.</p>
- <p class="note"><strong>NOTE</strong> Currently, files names should be 19 characters or less.</p>
- <li>Specify Advanced Options</li>
- <p>In Advanced options, specify the thread priority sample interval (Figure 5). The operating system is called automatically every millisecond to determine what thread is currently executing. This interval setting indicates how often an additional query to the operating system is made to determine the priority of the currently executing thread. The interval is specified in milliseconds. The default is 3000 milliseconds (3 seconds). You can get a thread priority as often as you like but be aware that frequent sampling of the OS may skew the performance measurement while making the call. There is a significant overhead to obtaining the priorities of all threads.</p>
- <p>You can choose an address/thread sampling interval between 1ms and 10000ms (10 seconds). For intervals greater than 1 ms, memory, power, priority and button events are sampled periodically; not every millisecond. Memory and button events are individual events. For memory and priority the current memory size and priority are recorded before entering the time interval, then changes during the interval are recorded and the final memory size and priority when it exits the interval is recorded.</p>
- <table width="600" border="1" align="center">
- <tr align="center">
- <td><b>S60</b></td>
- <td><b>UIQ</b></td>
- </tr>
- <tr align="center">
- <td width="50%"><div align="center"><img src="../profiler/images/AdvancedOptionsEditBox.png" width="240" height="320"></div></td>
- <td><div align="center"><img src="images/uiq_setting_advanced_settings.png" width="240" height="320"></div></td>
- </tr>
- </table>
- <p align="center" class="figure">Figure 5 - Priority sample interval</p>
- <li>Profile your application</li>
- <p>After establishing your desired options, select <strong>Options > Profiler > Start</strong> from the main window (Figure 6) to begin sampling. On UIQ devices you will see the state of the profiler change from “Ready” to “Initializing”, and then to “Profiling”. On S60 3.x devices the state will change from "Initializing" to "Sampling" and then "Finished". When the state has changed to “Profiling” or "Sampling", the trace activity has begun. Note that none of the configurations can be changed when the tracing is active.</p>
- <p class="note"> <b>IMPORTANT!</b> After the trace activity has started, leave the Profiler running in the background. Now you can proceed with the use case you wish to analyze. For example, run your application on the device.</p>
- <table width="600" border="1" align="center">
- <tr align="center">
- <td><b>S60</b></td>
- <td><b>UIQ</b></td>
- </tr>
- <tr align="center">
- <td width="50%"><div align="center"><img src="images/profiler_start_profiler.png" width="264" height="312"></div></td>
- <td><div align="center"><img src="images/profiler_start_profiler_uiq.png" width="240" height="320"></div></td>
- </tr>
- </table>
- <p align="center" class="figure">Figure 6 - Starting a trace session </p>
- <p>Stop the trace activity by switching back to the profiler and selecting <strong>Options > Profiler > Stop</strong>. Do not use the profiler while the trace data is being written to the data file. When the profiler is stopped, the profiler state shown in the main window will change from “profiling” to “stopping profiler”, and finally back to “ready”. The profiler data file is automatically written to the output previously selected. The actual amount of produced data depends on the length of time tracing was active and which trace options were selected. The Address/Thread trace alone produces approximately 1-4 Kbytes / second. Transfer the data file to your workstation to be analyzed with the analyzer.</p>
- </ol>
-</div>
-<p><strong>Related references </strong></p>
-<ul>
- <li><a href="../../tasks/profiler/prof_installation.htm">Installing the Profiler on the Target Device</a></li>
- <li><a href="../../tasks/analyser/an_load_trace_files.htm">Importing Profiler Data File for Analysis </a></li>
-</ul>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-</body>
-</html>
\ No newline at end of file
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+ <title>Using the Profiler</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+ <style type="text/css">
+<!--
+ .style1 {font-family: "Courier New", Courier, mono}
+-->
+
+ </style>
+</head>
+
+<body>
+<h2>Using the Profiler</h2>
+
+<h4>Overview</h4>
+
+<p>After successfully <a
+href="../../tasks/profiler/prof_installation.htm">installing</a> the Profiler
+.SISX file on your target device, you will be able to access the user
+interface. Run the <b>CarbidePI</b> application located in the
+“Installed” applications (Figure 1).</p>
+<p align="center"><img src="../profiler/images/SamplingProfilerMainWindow.png" ></p>
+
+
+
+<p align="center" class="figure">Figure 1 - Profiler Main Window (S60) </p>
+
+<p>In Options, configure the necessary run-time options. Specify which traces
+you want enabled, where to place the generated .dat profiler data file, the
+profiler file prefix, and the trace priority sampling interval.</p>
+
+<p>In the Profiler, the Address/Thread trace is <strong>always</strong> active
+when profiling is performed. Other traces are synchronized with the
+Address/Thread trace.</p>
+
+<p>In addition to Address/Thread trace, you can enable additional trace options
+such as dynamic binary support, memory and power usage, and function calls.</p>
+
+<div class="step">
+<h4>Profiling an Application</h4>
+<ol>
+ <li>Open the Profiler options screen
+ <p>Select the Tracing options menu from the Profiler menu (Figure 2) </p>
+ <p align="center"><img src="images/TracingOptions.png"></p>
+ </li>
+
+ <p class="figure">Figure 2 - Tracing Options</p>
+ <li>Enable or disable trace options</li>
+
+ <p>Specify On or Off for the available trace items - Dynamic binary support,
+ Function call capture, and Thread priority capture. (Figure 3).</p>
+
+ <blockquote>
+ <p align="left" class="note"><b>NOTE</b> If the executables you wish to
+ analyze are not in a ROM image (.symbol file) of your target device, then
+ you will need to turn on Dynamic binary support.</p>
+
+
+
+<p align="center"><img src="../profiler/images/TracingOptionsList.png" ></p>
+
+<p align="center"><img src="../profiler/images/TracingOptionsList2.png" ></p>
+
+
+ <p align="center" class="figure">Figure 3 - List of Trace Items</p>
+ <li>Specify Output</li>
+
+ <p>Specify the output for the sampled data (Figure 4). The output method can
+ be either the <span class="style1">File system</span> or <span
+ class="style1">Debug port</span>. If you select File system, you can save the
+ data file to a memory card or the target device C:\ drive. With the debug
+ port output method, you will need hardware (such as the Nokia Musti box)
+ connected to the XTI/STI debug port to capture the profiler data. There is
+ less profiler overhead if the debug port is used.</p>
+ <p align="center">
+ <img src="../profiler/images/OutputOptionsWindow_FileSystem.png"
+ ></p>
+
+
+
+ <p align="center" class="figure">Figure 4 - Output Options</p>
+
+ <p>You can specify the file prefix for data files. The name of the profiler
+ data file is formed from the prefix plus stream.dat. If you perform multiple
+ traces and use the file output option, include a hash mark (#) in your file
+ prefix. Subsequent traces will then be saved with different file names. The
+ hash mark is automatically replaced with a number. For example, if you define
+ the file prefix as <span class="style1">PI_#_</span>, multiple trace files
+ will be named <span class="style1">PI_1_STREAM.dat, PI_2_STREAM.dat, …
+ PI_100_STREAM.dat</span>. Only one hash mark is needed to provide sequential
+ numbering. If no hash mark is present, the same file will be overwritten with
+ the same name.</p>
+
+ <p class="note"><strong>NOTE</strong> Currently, files names should be 19
+ characters or less.</p>
+ <li>Specify Advanced Options</li>
+
+ <p>In Advanced options, specify the thread priority sample interval (Figure
+ 5). The operating system is called automatically every millisecond to
+ determine what thread is currently executing. This interval setting indicates
+ how often an additional query to the operating system is made to determine
+ the priority of the currently executing thread. The interval is specified in
+ milliseconds. The default is 3000 milliseconds (3 seconds). You can get a
+ thread priority as often as you like but be aware that frequent sampling of
+ the OS may skew the performance measurement while making the call. There is a
+ significant overhead to obtaining the priorities of all threads.</p>
+
+ <p>You can choose an address/thread sampling interval between 1ms and 10000ms
+ (10 seconds). For intervals greater than 1 ms, memory, power, priority and
+ button events are sampled periodically; not every millisecond. Memory and
+ button events are individual events. For memory and priority the current
+ memory size and priority are recorded before entering the time interval, then
+ changes during the interval are recorded and the final memory size and
+ priority when it exits the interval is recorded.</p>
+
+
+
+ <p align="center">
+ <img src="../profiler/images/AdvancedOptionsEditBox.png"
+></p>
+
+
+
+ <p align="center" class="figure">Figure 5 - Priority sample interval</p>
+ <li>Profile your application</li>
+
+ <p>After establishing your desired options, select <strong>Options >
+ Profiler > Start</strong> from the main window (Figure 6) to begin
+ sampling.The state will change from "Initializing" to "Sampling" and then
+ "Finished". When the state has changed to “Profiling” or
+ "Sampling", the trace activity has begun. Note that none of the
+ configurations can be changed when the tracing is active.</p>
+
+ <p class="note"><b>IMPORTANT!</b> After the trace activity has started, leave
+ the Profiler running in the background. Now you can proceed with the use case
+ you wish to analyze. For example, run your application on the device.</p>
+
+
+
+ <p align="center">
+ <img src="images/profiler_start_profiler.png"
+></p>
+
+
+
+ <p align="center" class="figure">Figure 6 - Starting a trace session </p>
+
+ <p>Stop the trace activity by switching back to the profiler and selecting
+ <strong>Options > Profiler > Stop</strong>. Do not use the profiler
+ while the trace data is being written to the data file. When the profiler is
+ stopped, the profiler state shown in the main window will change from
+ “profiling” to “stopping profiler”, and finally back
+ to “ready”. The profiler data file is automatically written to
+ the output previously selected. The actual amount of produced data depends on
+ the length of time tracing was active and which trace options were selected.
+ The Address/Thread trace alone produces approximately 1-4 Kbytes / second.
+ Transfer the data file to your workstation to be analyzed with the
+ analyzer.</p>
+</ol>
+</div>
+
+<p><strong>Related references </strong></p>
+<ul>
+ <li><a href="../../tasks/profiler/prof_installation.htm">Installing the
+ Profiler on the Target Device</a></li>
+ <li><a href="../../tasks/analyser/an_load_trace_files.htm">Importing Profiler
+ Data File for Analysis </a></li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/tracing_options.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/profiler/tracing_options.htm Wed Jun 23 15:05:09 2010 +0300
@@ -1,84 +1,114 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Setting Tracing Options</title>
- <link href="../../../book.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
-<h2>Setting Tracing Options </h2>
-<p>Use the <b>Tracing</b> options menu in the Profiler to specify the types of tracing data to collect when profiling an application executing on a device.</p>
-<table width="650" border="1" align="center">
- <tr>
- <td width="33"><b>S60</b></td>
- <td width="593"><div align="center"><img src="images/TracingOptionsList.png" width="264" height="312"> <img src="images/TracingOptionsList2.png" width="264" height="312"></div></td>
- </tr>
- <tr>
- <td><b>UIQ</b></td>
- <td><div align="center"><img src="images/uiq_setting_tracing_options.png" width="240" height="320"></div></td>
- </tr>
-</table>
-<p class="figure">Figure 1. Tracing options screen in Profiler (S60 and UIQ)</p>
-<p> The tracing options include:</p>
-<h5>Table 1. <span class="figure">Profiler Tracing Options</span></h5>
-<table width="94%" border="0" cellpadding="2" cellspacing="0">
- <tr>
- <th width="226" scope="col">Menu Option </th>
- <th width="616" scope="col">Description</th>
- </tr>
- <tr>
- <td><b>Dynamic binary support</b></td>
- <td><p>Enable (On) or disable (Off) dynamic binary tracing in your profiling task. </p>
- <p>If the executables you wish to analyze are not in a ROM image (.symbol file) of your target device, then you will need to turn on Dynamic binary support.</p></td>
- </tr>
- <tr>
- <td><b>Function call capture </b></td>
- <td>Enable (On) or disable (Off) function call information in your profiling task. If disabled, then <a href="../analyzer/function_calls.htm">Function call</a> information will not appear in the Analyzer.</td>
- </tr>
- <tr>
- <td><b>Button press capture </b></td>
- <td>Enable (On) or disable (Off) the gathering of button press information in your profiling task. If disabled, then Button Press information will not appear in the Analyzer.</td>
- </tr>
- <tr>
- <td><b>Memory usage capture </b></td>
- <td>Enable (On) or disable (Off) memory usage information in your profiling task. If disabled, then Memory usage information will not appear in the Analyzer.</td>
- </tr>
- <tr>
- <td><b>Thread priority capture </b></td>
- <td><p>Enable (On) or disable (Off) Thread priority information. If enabled, captured data will include the time and priority ranking of the currently executing thread when the operating system is called.</p>
- <p>If disabled, then thread priority information is not included and a Priority List column will not be shown in the <a href="../analyzer/thread_load.htm">Thread Load</a> table in the Analyzer.</p></td>
- </tr>
- <tr>
- <td><b>Power usage capture </b></td>
- <td><p>Enable (On) or disable (Off) power usage information in your profiling task. If disabled, then Power usage information will not appear in the Analyzer.</p>
- <p class="note"><b>NOTE</b> Power usage capture is not available in UIQ version. </span></p></td>
- </tr>
-</table>
-<div class="step">
- <h4>Setting a Tracing Option</h4>
- <ol>
- <li>Launch the Profiler application on the target device </li>
-<li>Open the Profiler options screen: </li>
- <ul>
- <li>S60 - Select the Tracing menu</li>
- <li>UIQ - Select the Tracing Options menu</li>
-</ul>
- <li>Set the desired option on or off</li>
- <li>Exit the screen</li>
- </ol>
-</div>
-<h5>Related references
-</h5>
-<ul>
- <li><a href="prof_using.htm">Using the Profiler</a></li>
-</ul>
-<h5>Related tasks</h5>
-<ul>
- <li><a href="advanced_options.htm">Setting Advanced Options</a></li>
- <li><a href="output_settings.htm">Setting Output Settings </a> </li>
-</ul>
-<div id="footer">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Setting Tracing Options</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Setting Tracing Options </h2>
+
+<p>Use the <b>Tracing</b> options menu in the Profiler to specify the types of
+tracing data to collect when profiling an application executing on a device.</p>
+
+<p align="center"><img src="images/TracingOptionsList.png">Â <img
+src="images/TracingOptionsList2.png"></p>
+
+<p class="figure">Figure 1. Tracing options screen in Profiler (S60)</p>
+
+<p>The tracing options include:</p>
+
+<h5>Table 1. <span class="figure">Profiler Tracing Options</span></h5>
+
+<table width="94%" border="0" cellpadding="2" cellspacing="0">
+ <tbody>
+ <tr>
+ <th width="226" scope="col">Menu Option </th>
+ <th width="616" scope="col">Description</th>
+ </tr>
+ <tr>
+ <td><b>Dynamic binary support</b></td>
+ <td><p>Enable (On) or disable (Off) dynamic binary tracing in your
+ profiling task. </p>
+
+ <p>If the executables you wish to analyze are not in a ROM image
+ (.symbol file) of your target device, then you will need to turn on
+ Dynamic binary support.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><b>Function call capture </b></td>
+ <td>Enable (On) or disable (Off) function call information in your
+ profiling task. If disabled, then <a
+ href="../analyzer/function_calls.htm">Function call</a> information
+ will not appear in the Analyzer.</td>
+ </tr>
+ <tr>
+ <td><b>Button press capture </b></td>
+ <td>Enable (On) or disable (Off) the gathering of button press
+ information in your profiling task. If disabled, then Button Press
+ information will not appear in the Analyzer.</td>
+ </tr>
+ <tr>
+ <td><b>Memory usage capture </b></td>
+ <td>Enable (On) or disable (Off) memory usage information in your
+ profiling task. If disabled, then Memory usage information will not
+ appear in the Analyzer.</td>
+ </tr>
+ <tr>
+ <td><b>Thread priority capture </b></td>
+ <td><p>Enable (On) or disable (Off) Thread priority information. If
+ enabled, captured data will include the time and priority ranking of
+ the currently executing thread when the operating system is called.</p>
+
+ <p>If disabled, then thread priority information is not included and a
+ Priority List column will not be shown in the <a
+ href="../analyzer/thread_load.htm">Thread Load</a> table in the
+ Analyzer.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><b>Power usage capture </b></td>
+ <td><p>Enable (On) or disable (Off) power usage information in your
+ profiling task. If disabled, then Power usage information will not
+ appear in the Analyzer.</p>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<div class="step">
+<h4>Setting a Tracing Option</h4>
+<ol>
+ <li>Launch the Profiler application on the target device </li>
+ <li>Open the Profiler options screen: </li>
+</ol>
+<ul>
+ <li>Select the Tracing menu</li>
+ <li>Set the desired option on or off</li>
+ <li>Exit the screen</li>
+</ul>
+<ul>
+</ul>
+</div>
+
+<h5>Related references </h5>
+<ul>
+ <li><a href="prof_using.htm">Using the Profiler</a></li>
+</ul>
+
+<h5>Related tasks</h5>
+<ul>
+ <li><a href="advanced_options.htm">Setting Advanced Options</a></li>
+ <li><a href="output_settings.htm">Setting Output Settings </a> </li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/release_notes.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/release_notes.htm Wed Jun 23 15:05:09 2010 +0300
@@ -16,9 +16,9 @@
<h2>Release Notes</h2>
<h4>Performance Investigator Analyser Carbide.c++ Extension – Version
-2.3.0</h4>
+2.4.0</h4>
-<p>Released 21st April 2010</p>
+<p>Released June 20th, 2010</p>
<ul>
<li><a href="#whatsNew">What's new </a></li>
<li><a href="#agent">Target Performance Investigator Agent</a></li>
@@ -27,25 +27,22 @@
</ul>
<h3><a name="whatsNew" id="whatsNew"></a>What's New </h3>
-
-<p><strong>2.3.0</strong></p>
<ul>
- <li><b>Performance improvements</b> — Improved overall memory
- consumption. </li>
- <li><b>Version numbers harmonized</b> — Version numbers of Performance
- Investigator plug-ins and feature increased to 2.3.0.</li>
- <li><b>Instruction trace (ITT) support</b> — Support for the RVCT 4.0
- map file format.</li>
- <li><b>Library event support</b> — Memory plug-in supports
- investigating memory usage by a library from the application developer's
- point of view. </li>
- <li><b>Performance Investigator Import Wizard</b> — Support for
- importing multiple profiler data files with the same configuration from a
- file system, and a new possibility to select the desired views from the
- available trace types for each imported file. </li>
+ <li><b>Graphics Memory Usage data support</b>— Support for viewing
+ graphics memory usage. Both private and shared graphics memory usage can be
+ displayed in the graph.</li>
+ <li><b>Performance Investigator Wizard </b>— Support for tracing
+ Profiler data remotely from the device.</li>
+ <li><b>Performance Investigator View </b>— Support for handling
+ imported Profiler data files on the view.</li>
+ <li><b>Performance Counters Graph and Table</b> — Support for viewing
+ and analyzing the CPU clock rate.</li>
+ <li><b>CPU Thread Load Graph and Table </b>— Support for scaling the
+ thread load to the CPU Clock Speed.</li>
</ul>
-<h3><a name="agent"></a>Target Performance Investigator Profiler </h3>
+<h3><a name="agent" id="agent"></a>Target Performance Investigator Profiler
+</h3>
<ul>
<li>To produce a Profiler data file, you need to install one of these
profiler agents:
@@ -162,6 +159,23 @@
<h3>Version history</h3>
+<p><strong>2.3.0</strong></p>
+<ul>
+ <li><b>Performance improvements</b> — Improved overall memory
+ consumption. </li>
+ <li><b>Version numbers harmonized</b> — Version numbers of Performance
+ Investigator plug-ins and feature increased to 2.3.0.</li>
+ <li><b>Instruction trace (ITT) support</b> — Support for the RVCT 4.0
+ map file format.</li>
+ <li><b>Library event support</b> — Memory plug-in supports
+ investigating memory usage by a library from the application developer's
+ point of view. </li>
+ <li><b>Performance Investigator Import Wizard</b> — Support for
+ importing multiple profiler data files with the same configuration from a
+ file system, and a new possibility to select the desired views from the
+ available trace types for each imported file. </li>
+</ul>
+
<p><strong>2.2.0</strong></p>
<ul>
<li><b>Interrupt support</b> — Support for viewing software and
@@ -177,7 +191,8 @@
viewing interconnect performance counter traces. This feature has been
ported from Bappea to Performance Investigator.</li>
<li><b>SMP support for CPU Profiler</b> — The Threads view can now be
- broken down into separate graphs, one per available CPU on SMP systems.</li>
+ broken down into separate graphs, one per each available CPU on SMP
+ systems.</li>
<li><b>Usability enhancements for graphs</b> — Title bar added for each
graph for manipulating the location and size of a single graph.</li>
<li><b>Version numbers harmonized</b> — Version numbers of Performance
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/an_load_trace_files.htm Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/an_load_trace_files.htm Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
- <title>Loading Sample Trace File for Analysis</title>
+ <title>Importing Profiler Data Files</title>
<link href="../../../book.css" rel="stylesheet" type="text/css">
</head>
@@ -15,10 +15,11 @@
converts the file into a format that can be displayed by the analyzer (a .NPI
file).</p>
-<p class="note"><strong>NOTE</strong> If a large .dat file is imported, the
-graph and table response time will slow down until the large NPI file is saved.
-Saving the NPI file will be performed in the background and cannot be
-canceled.</p>
+<p class="note"><strong>NOTE</strong> You do not necessarily need to collect
+the performance data by using PI Profiler on the device, but you can also do
+profiling remotely, directly from the PI Wizard in Carbide.c++. For more
+information, see <a href="collect_prof_data_remotely.htm">Collecting Profiler
+Data Remotely</a>.</p>
<p>Importing a profiler data file will vary depending on if your application
was built by Carbide.c++ or is a standalone application. To find the binaries
@@ -34,32 +35,41 @@
Profiler application when capturing your application data in a profiler data
file.</p>
+<p class="note"><strong>NOTE</strong> If a large .dat file is imported, the
+graph and table response time will slow down until the large NPI file is saved.
+Saving the NPI file will be performed in the background and cannot be
+canceled.</p>
+
<p>To import your profiler data file, perform the following steps.</p>
<div class="step">
<h4>Importing a Profiler Data File</h4>
<ol>
- <li><a name="Select_Performance_Investigator_Data"></a>Select Performance
- Investigator Data</li>
-
- <p>Select <strong>File > Import...</strong> from Carbide.c++ to display
- Import dialog box (Figure 1), and select Performance Investigator Data and
- click <strong>Next</strong>.</p>
-
- <p align="center"><img src="images/importdatfile_step1.png"></p>
-
- <p align="center" class="figure">Figure 1. Carbide.c++ Import window </p>
+ <li><a name="Select_Performance_Investigator_Data"></a>Start the import
+ wizard form the Carbice.c++ toolbat by selecting <strong>Carbide</strong>
+ > <strong>Performance Investigator</strong></li>
<li><a name="Select_Profiler_Data_File"
id="Select_Profiler_Data_File"></a>Select Profiler Data File(s)
+ <p>First use the radio buttons and select to get profiler data <strong>From
+ File System</strong>. </p>
+ <p class="note"><strong>NOTE</strong> Use the <strong>From Device via
+ TraceViewer</strong> option if you want to collect new profiler data
+ remotely from the device. For more information, see <a
+ href="collect_prof_data_remotely.htm">Collecting Profiler Data
+ Remotely</a>.</p>
<p>Select .dat file(s) to the <strong>From File System</strong> list by
selecting either</p>
<ul>
<li><strong>Add File</strong> and browsing to the file, or</li>
<li><strong>Add Directory</strong> and browsing to the directory you want
to import files from.</li>
- <li>The .dat file(s) will be converted to a format displayable by the
- Carbide.c++ analyzer and assigned the .npi extension. </li>
+ <li>Use the <strong>Remove</strong> button to remove one file from the
+ list, or</li>
+ <li>Use the <strong>Remove All</strong> button to clear all files from
+ the list.</li>
</ul>
+ <p>The .dat file(s) will be converted to a format displayable by the
+ Carbide.c++ analyzer and assigned the .npi extension. </p>
<p>After selecting the file, the <strong>PI views included in the
analysis</strong><strong>for <em>filename</em>.dat</strong> table will
display a list of available views, according to the trace types available
@@ -69,9 +79,11 @@
you can de-select the types you do not wish to include in the analysis.
The CPU load view is a mandatory analysis and cannot be
de-selected.</li>
+ <li>The trace types/views are selected separately for each .dat file.</li>
</ul>
- <p>Click Next to continue. </p>
- <p align="center"><img src="images/CB_import_step2.PNG" alt=""></p>
+ <p>After selecting the files and views, click <strong>Next</strong> to
+ continue. </p>
+ <p align="center"><img src="images/CB_import_step2.png"></p>
<p align="center" class="figure">Figure 2. Select Profiler Data File</p>
</li>
<li><a name="Select_Known_Available_Information"></a>Select Known Available
@@ -98,9 +110,8 @@
in remaining pages, since there is no previous import related to the new
workspace. For a new imported .dat file, a new output file name will be
generated based on this input file name (+ (digit) + .npi).</p>
- <p align="center"><img src="images/import_dat_file_step3.png"></p>
- <p align="center" class="figure">Figure 3. Enter known Available
- Information</p>
+ <p align="center"><img src="images/importdatfile_step3.png"> </p>
+ <p class="figure">Figure 3. Enter known Available Information</p>
</li>
<li><a name="ROM_files"></a>If <strong>Both</strong> or <strong>the ROM image
symbol file</strong> option is selected, the <strong>Select build files
@@ -148,31 +159,60 @@
<li><a name="Select_Output_File_and_Project"></a>Select Output File and
Project </li>
- <p>Use the Output File and Project page to import the .dat file into an
+ <p>Use the Output File and Project page to import the *.npi file into an
existing project or create a new empty project. </p>
+ <p class="note">NOTE If you used remote profiling for collecting profiler
+ data from the device, the original *.dat file will also be included in the
+ selected project.</p>
+
<p align="center"><img src="images/import_dat_file_step5.png"></p>
<p align="center" class="figure">Figure 7. Enter Output File and Project
Information</p>
- <li>Click Finish to create the *.npi file.</li>
+ <li>Click Finish to create the *.npi file.
+ <p class="note">NOTE Carbide.c++ reserves a large block of memory for the
+ Java Virtual Machine (JVM) to run the whole IDE. However, in some cases,
+ where Profiler trace log is too long in time and/or CPU load has been
+ extensively high over the use case, the trace import process may fail due
+ to out-of-memory situation. The out-of-menory may also lead to instability
+ issues with Carbide itself, but an error message will be always be shown:
+ <strong>Multiple problems have occurred</strong>. Jave heap space.<br>
+ This problem can be avoided by keeping the profiled use cases shorter (the
+ recommendation is maximum 5 minutes), and by selecting only those Profiler
+ plug-ins that are needed for analysing the use case. Shorter use cases (in
+ time) and smaller amount of selected profiler plug-ins also ease up the
+ analysis phase, since it is easier to a browse shorter set of data and to
+ pinpoint the possible performance issues within the trace.<br>
+ If you need to analyse longer use cases, there are also other tools
+ available for long-period-testing (LPT). For example, you can run the Nokia
+ Energy Profiler (NEP) directly on target and it can be used for LPT type of
+ use cases.</p>
+ </li>
<li>If <b>Instructions executed</b> has been selected as one of the trace, a
the dialog below is displayed during PIAnalyser file import (once for each
file f several are imported):
<p align="center"><img
- src="../../reference/analyzer/images/MIPS_speed_dialog.png"></p>
+ src="../../reference/analyzer/images/MIPS_speed_dialog.png" alt=""></p>
</li>
- <li>If you imported only one file, PIAnalyser will open showing the views
- selected for that file.
- <p>If you imported several files, a project will be opened to the
- <strong>Carbide Project Explorer</strong> where you can choose the file to
- be viewed with PIAnalyser.</p>
+ <li><strong>Performance Investigator</strong> view will open with the
+ imported files listed in it. A project will also be opened to the
+ <strong>Carbide Project Explorer</strong> including the imported files.
+ <p>If you imported only one file, PIAnalyser will also open showing the
+ views selected for that file. If you imported several files, you can open
+ any one of them by double-clicking the file name in the Performance
+ Investigator view or in the Project Explorer.</p>
</li>
</ol>
</div>
<p align="left"><strong>Related references</strong></p>
<ul>
+ <li><a href="collect_prof_data_remotely.htm"></a><a
+ href="../../reference/analyzer/import_rom_build_files.htm">Select build
+ files from ROM</a></li>
+ <li><a href="collect_prof_data_remotely.htm">Collecting Profiler Data
+ Remotely</a></li>
<li><a href="../../reference/analyzer/main_view.htm">Analyzer View</a></li>
<li><a href="key_profile_pref.htm">Key Press Profile</a> </li>
</ul>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/collect_prof_data_remotely.htm Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,110 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
+ <title>Collecting profiler data remotely</title>
+ <link href="../../../book.css" rel="stylesheet" type="text/css">
+</head>
+
+<body>
+<h2>Collecting Profiler Data Remotely</h2>
+
+<p>Instead of collecting performance data with PI Profiler on the device and
+importing it to Carbide.c++, you can also collect performance data directly
+from Carbide. The PI Import Wizard offers the option of collecting profiler
+data remotely from a device via a TraceViewer connection.</p>
+
+<p>To collect profiler data remotely, perform the following steps.</p>
+
+<div class="step">
+<h3>Importing a Profiler Data File</h3>
+
+<h5>Open Import Wizard</h5>
+
+<p>In Carbide.c++, select <strong>Carbide</strong> > <strong>Performance
+Investigator</strong>.</p>
+
+<h5><a name="Select_Profiler_Data_File"
+id="Select_Profiler_Data_File"></a>Select Profiler Data File(s)</h5>
+<ol>
+ <li><a name="First" id="First">First use the radio buttons and select to get
+ profiler data <strong>From Device via TraceViewer</strong></a> .
+ <p class="note"><strong>NOTE</strong> Use the <strong>From File
+ System</strong> option if you want to import existing PI Profiler data
+ files. For more information see <a href="an_load_trace_files.htm">Importing
+ Profiler Data files</a>.</p>
+ <p>The Wizard automatically tries to fetch information on supported plugins
+ from the connected device. If you already have set up a working connection,
+ the plugins are listed in the <strong>Select Plug-ins for Tracing</strong>
+ field. Otherwise you will get the below notice: </p>
+ <p align="center"><img src="images/Import_wizard_error.png" alt=""></p>
+ <p align="center" class="figure">Figure 2. Import wizard notice </p>
+ <p>In this case, or if you want to change the settings, follow the
+ instructions below:</p>
+ <ul>
+ <li>Select Connection settings to open the TraceViewer Connections
+ Setting dialog. Select the connection you want to use or create a new
+ one. For more information, see TraceViewer <a
+ href="../../../../com.nokia.traceviewer.help/html/reference/preferencesconnection.htm">Connection
+ Settings</a>.
+ <p class="note"><strong>NOTE</strong> You can use a USB or a TCP/IP
+ Musti connection, but for profiling several samplers Musti is
+ recommended due the too high amount of data.</p>
+ </li>
+ <li>Click <strong>OK</strong> in the Connection Setting dialog to save
+ the settings and exit.
+ <p>The selected connections is now shown below the <strong>Connections
+ Settings</strong> button.</p>
+ </li>
+ <li>Click <strong>Refresh Plug-ins List</strong> .
+ <p>The Wizard fetches the information on supported plugins and updates
+ them to the <strong>Select Plug-ins for Tracing</strong> list.</p>
+ <p align="center"><img src="images/PI_Wizard_Trace.png"></p>
+ <p align="center" class="figure">Figure 3. Select Profiler Data File</p>
+ </li>
+ </ul>
+ </li>
+ <li><a name="Select" id="Select">Select the plug-ins you want to trace from
+ the list</a>.</li>
+ <li>Fill in the <strong>Profiler Data File Prefix</strong> you want to use as
+ the name of the Profiler .dat file created.</li>
+ <li>Click <strong>Start Tracing</strong>.
+ <p>The wizard starts tracing. You can see the name of the created base64
+ encoded file (<em>*.base64</em>), the trace time (how long the trace has
+ been running), as well as the size of the file in the <strong>Created
+ Profiler Data File(s)</strong> list. </p>
+ </li>
+ <li id="Stop">Click <strong>Stop Tracing</strong> to finish tracing.
+ <p>Tracing stops and the Wizard start converting the <em>*.base64</em> file
+ into a <em>*.dat</em> file. You can follow the progress of the conversion
+ from the progress bar. When the conversion is done, you can see the name of
+ the file in the <strong>Created Profiler Data File(s)</strong> list change
+ to <em>*.dat</em>.</p>
+ </li>
+</ol>
+
+<p>It is possible to import several Profiler data files, so after the tracing
+and file conversion, you can either</p>
+<ul>
+ <li>Run another trace, with or without changing the setting first, or</li>
+ <li>Click <strong>Next ></strong> to continue importing the file(s). For
+ instructions, see step 3 in <a
+ href="an_load_trace_files.htm#Select_Known_Available_Information">Importing
+ Profiler Data Files</a>. </li>
+</ul>
+</div>
+
+<p align="left"><strong>Related references</strong></p>
+<ul>
+ <li><a href="an_load_trace_files.htm">Importing Profiler Data files</a></li>
+ <li><a href="../../reference/analyzer/main_view.htm">Analyzer View</a></li>
+ <li><a href="key_profile_pref.htm">Key Press Profile</a> </li>
+</ul>
+
+<div id="footer">
+Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+reserved. <br>
+License: <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
+</body>
+</html>
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/images/CB_import_step2.PNG has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/images/Import_wizard_error.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/images/PI_Wizard_Trace.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/images/importdatfile_step3.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/tasks/analyser/images/pi_pref_edit.png has changed
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/intro/tutorialsProfilerExtContent.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/intro/tutorialsProfilerExtContent.xml Wed Jun 23 15:05:09 2010 +0300
@@ -1,17 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<introContent>
- <!-- Extension to the SDK Tutorial Page. -->
- <extensionContent alt-style="css/swt.properties" style="css/tutorials.css" path="tutorials/page-content/carbideAnchor">
-
- <group id="tutorials-group" label="Performance Investigator tutorials" style-id="tutorials-group" >
+<!-- Extension to the Tutorials page. -->
+
+ <extensionContent
+ id="com.nokia.carbide.cpp.pi.doc.user-tutorials"
+ alt-style="pi.properties"
+ style="pi.css"
+ path="tutorials/@">
+
+ <group
+ id="pi"
+ style-id="content-group">
- <link label="PI tutorial#1" url="http://org.eclipse.ui.intro/showHelpTopic?id=/com.nokia.carbide.cpp.pi.doc.user/tutorials/piTutorial.html" id="carbideapp" style-id="tutorials-link" >
- <text>Create a birthday tracking program that demonstrates S60 UI, proper UI and data separation, and simple persistent storage.</text>
- </link>
-
+ <link
+ label="Performance Investigator tutorial"
+ url="http://org.eclipse.ui.intro/showStandby?partId=org.eclipse.platform.cheatsheet&input=com.nokia.carbide.cpp.pi.doc.user.getStarted"
+ id="pi-app"
+ style-id="content-link">
+ <text>Start profiling a target device by following step-by-step instructions.</text>
+ </link>
+
</group>
</extensionContent>
-
+
</introContent>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/plugin.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/plugin.xml Wed Jun 23 15:05:09 2010 +0300
@@ -32,19 +32,19 @@
<extension
point="org.eclipse.ui.cheatsheets.cheatSheetContent">
<category
- id="com.nokia.carbide.cpp.pi.cheatsheets"
- name="Carbide.c++ Performance Investigator" />
+ id="com.nokia.carbide.cpp.tools.cheatsheets"
+ name="Carbide.c++ Tools" />
<cheatsheet
- category="com.nokia.carbide.cpp.pi.cheatsheets"
- contentFile="html/cheatsheets/getStarted_pi_cs.xml"
+ category="com.nokia.carbide.cpp.tools.cheatsheets"
+ contentFile="html/cheatsheets/getStarted_pi2_cs.xml"
id="com.nokia.carbide.cpp.pi.doc.user.getStarted"
- name="Performance Investigator Setup"/>
+ name="Performance Investigator Setup for Remote Profiling"/>
<cheatsheet
- category="com.nokia.carbide.cpp.pi.cheatsheets"
+ category="com.nokia.carbide.cpp.tools.cheatsheets"
composite="false"
- contentFile="$nl$/html/cheatsheets/getStarted_pi_cs.xml"
+ contentFile="$nl$/html/cheatsheets/getStarted_pi1_cs.xml"
id="com.nokia.carbide.cpp.pi.help.cheatsheet919016247"
- name="Performance Investigator Setup">
+ name="Performance Investigator Setup for On-device profing">
</cheatsheet>
</extension>
@@ -62,13 +62,13 @@
configId="org.eclipse.ui.intro.universalConfig"
content="intro/whatsnewProfilerExtContent.xml" />
-<!-- <configExtension
- configId="com.nokia.carbide.cpp.introConfig"
+ <configExtension
+ configId="org.eclipse.ui.intro.universalConfig"
content="intro/tutorialsProfilerExtContent.xml" />
--->
+
+
</extension>
-
<!-- CONTEXT IDs for CONTEXTUAL HELP in windows, dialogs, and views -->
<extension point="org.eclipse.help.contexts" >
@@ -88,6 +88,11 @@
<!-- PI IMPORT WIZARD -->
<contexts file="html/context_help/com_nokia_carbide_pi_wizards.xml"
plugin="com.nokia.carbide.cpp.pi.wizards" />
+
+ <!-- PI VIEW -->
+ <contexts
+ file="html/context_help/com_nokia_carbide_pi_view.xml"
+ plugin="com.nokia.carbide.cpp.pi.view" />
<!-- ECLIPSE NEW/IMPORT/EXPORT WIZARDS and PREF PANELS HELP -->
<contexts file="html/context_help/org_eclipse_ui.xml"
@@ -97,6 +102,10 @@
plugin="com.nokia.carbide.cpp.pi.memory">
</contexts>
<contexts
+ file="html/context_help/com_nokia_carbide_pi_graphicsmemory.xml"
+ plugin="com.nokia.carbide.cpp.pi.graphicsmemory">
+ </contexts>
+ <contexts
file="html/context_help/com_nokia_carbide_pi_pec.xml"
plugin="com.nokia.carbide.cpp.pi.perfcounters">
</contexts>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/tocAnalyzer.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/tocAnalyzer.xml Wed Jun 23 15:05:09 2010 +0300
@@ -6,48 +6,68 @@
<topic label="Analyzer Overview" href="html/reference/analyzer/analyser.htm" >
<topic label="Performance Investigator Analyzer" href="html/concepts/analyser.htm" />
<topic label="Basic Operation" href="html/concepts/basic_operation.htm" />
- <topic label="Controls" href="html/reference/analyzer/GUI_tour.htm" />
+ <topic label="GUI Controls" href="html/reference/analyzer/GUI_tour.htm" />
<topic label="Graph views" href="html/reference/analyzer/main_view.htm" >
- <topic label="Thread Load" href="html/reference/analyzer/thread_load.htm" />
- <topic label="Binary Load" href="html/reference/analyzer/binary_load.htm" />
- <topic label="Function Load" href="html/reference/analyzer/function_load.htm" />
- <topic label="Function Calls" href="html/reference/analyzer/function_calls.htm" />
</topic>
<topic label="Threshold Limits for Traced Data" href="html/reference/analyzer/threshold.htm" />
</topic>
+ <topic href="html/tasks/analyser/collect_prof_data_remotely.htm" label="Collecting Profiler Data Remotely">
+ </topic>
<topic label="Importing Profiler Data Files" href="html/tasks/analyser/an_load_trace_files.htm" >
<topic label="Select Build Files for ROM" href="html/reference/analyzer/import_rom_build_files.htm" />
</topic>
- <topic label="Examining a Profiling Project" href="html/Getting_Started/example_project.htm" />
+ <topic href="html/reference/analyzer/PI_view.htm" label="PI View">
+ </topic>
<topic label="Menus">
<topic label="Context Menu Options" href="html/reference/analyzer/context_menu.htm" />
<topic label="Save Table" href="html/reference/analyzer/save_table.htm" />
<topic label="Investigator menu" href="html/reference/analyzer/investigator_menu.htm" />
- <topic label="Memory Graph" href="html/reference/analyzer/menu_memory_graph.htm" />
- <topic label="Power Graph" href="html/reference/analyzer/menu_power_graph.htm" />
+ <topic label="Memory Graph Menu" href="html/reference/analyzer/menu_memory_graph.htm" />
+ <topic href="html/reference/analyzer/menu_graphics_memory_graph.htm" label="Graphics Memory Graph Menu">
+ </topic>
+ <topic label="Power Graph Menu" href="html/reference/analyzer/menu_power_graph.htm" />
<topic label="Show Button Events" href="html/tasks/analyser/btn_press_show.htm" />
</topic>
+ <topic href="html/reference/analyzer/view_CPU.htm" label="CPU views">
+ <topic href="html/reference/analyzer/thread_load.htm" label="Thread Load">
+ </topic>
+ <topic href="html/reference/analyzer/binary_load.htm" label="Binary Load">
+ </topic>
+ <topic href="html/reference/analyzer/function_load.htm" label="Function Load">
+ </topic>
+ <topic href="html/reference/analyzer/function_calls.htm" label="Function Calls">
+ </topic>
+ </topic>
<topic label="Memory Usage" href="html/concepts/memory_usage_capture.htm" >
<topic label="Memory Usage view" href="html/reference/analyzer/view_memory_usage.htm" />
<topic label="Memory Usage Statistics" href="html/reference/analyzer/wnd_memory_usage_statistics.htm" />
<topic label="Memory Usage menu" href="html/reference/analyzer/menu_memory_graph.htm" />
</topic>
+ <topic href="html/reference/analyzer/view_graphics_memory_usage.htm" label="Graphics Memory Usage">
+ <topic href="html/reference/analyzer/menu_graphics_memory_graph.htm" label="Graphics Memory Graph Menu">
+ </topic>
+ <topic href="html/reference/analyzer/wnd_graphics_memory_usage_statistics.htm" label="Graphics Memory Usage Statistics">
+ </topic>
+ </topic>
+
<topic label="Power Usage" href="html/reference/analyzer/view_power_usage.htm" >
<topic label="Power Usage Settings" href="html/reference/analyzer/wnd_power_graph_settings.htm" />
<topic label="Power Usage Statistics" href="html/reference/analyzer/wnd_power_usage_statistics.htm" />
<topic label="Power Graph menu" href="html/reference/analyzer/menu_power_graph.htm" />
</topic>
- <topic href="html/reference/analyzer/interrupts_view.htm" label="Interrupts View">
+ <topic href="html/reference/analyzer/interrupts_view.htm" label="Interrupts">
</topic>
- <topic href="html/reference/analyzer/view_performance_counters.htm" label="Performance Counters View">
+ <topic href="html/reference/analyzer/view_performance_counters.htm" label="Performance Counters">
<topic href="html/reference/analyzer/traceable_events.htm" label="Traceable Event Types">
</topic>
<topic href="html/reference/profiler/Prof_counter_settings.htm" label="PIProfiler Performance Counter Settings">
</topic>
+ <topic href="html/reference/analyzer/MIPS_counter_graph.htm" label="MIPS Counter and Graph">
+ </topic>
</topic>
<topic href="html/reference/analyzer/view_IPC.htm" label="Interconnect Performance Counters">
</topic>
@@ -60,8 +80,11 @@
<topic label="Setting Key Press Profile" href="html/tasks/analyser/key_profile_pref.htm" />
</topic>
+ <topic label="Examining a Profiling Project" href="html/Getting_Started/example_project.htm" />
<topic label="Using Source Lookup" href="html/tasks/analyser/source_lookup.htm" />
<topic label="Analyzing Table Data" href="html/reference/analyzer/analyzing_table_data.htm" />
+ <topic href="html/reference/analyzer/troubleshooting.htm" label="Troubleshooting">
+ </topic>
</toc>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/tocPI.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/tocPI.xml Wed Jun 23 15:05:09 2010 +0300
@@ -22,7 +22,6 @@
<topic label="Acronyms" href="html/reference/abbrev.htm" />
- <topic label="Bugs fixed" href="html/bugs_fixed.htm" />
<topic label="Legal" href="html/legal.htm" />
</topic>
</toc>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.function/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.function/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Functions
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.function;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.function.FunctionPlugin
Bundle-Vendor: Nokia
Bundle-Localization: plugin
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.function/src/com/nokia/carbide/cpp/pi/function/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.function/src/com/nokia/carbide/cpp/pi/function/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.function.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.function/src/com/nokia/carbide/cpp/pi/function/NewFunctionAnalyse.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.function/src/com/nokia/carbide/cpp/pi/function/NewFunctionAnalyse.java Wed Jun 23 15:05:09 2010 +0300
@@ -1339,20 +1339,20 @@
if ((this.symbolPrimary || this.ittTrace == null) &&
!s.getCurrentFunctionSym().getFunctionBinary().getBinaryName().endsWith(Messages.getString("NewFunctionAnalyse.notFound")) ) //$NON-NLS-1$
{
- return new Long(s.programCounter-s.getCurrentFunctionSym().getStartAddress().longValue());
+ return Long.valueOf(s.programCounter-s.getCurrentFunctionSym().getStartAddress().longValue());
}
if (s.getCurrentFunctionItt() != null && !s.getCurrentFunctionItt().getFunctionName().endsWith(Messages.getString("NewFunctionAnalyse.notFound"))) //$NON-NLS-1$
{
//System.out.println("OFF:"+(s.programCounter-s.currentFunctionItt.startAddress.longValue())+" PC: "+Long.toHexString(s.programCounter)+" start"+Long.toHexString(s.currentFunctionItt.startAddress.longValue()));
- return new Long(s.programCounter-s.getCurrentFunctionItt().getStartAddress().longValue());
+ return Long.valueOf(s.programCounter-s.getCurrentFunctionItt().getStartAddress().longValue());
}
else if (s.getCurrentFunctionSym() != null)
{
- return new Long(s.programCounter-s.getCurrentFunctionSym().getStartAddress().longValue());
+ return Long.valueOf(s.programCounter-s.getCurrentFunctionSym().getStartAddress().longValue());
}
else
{
- return new Long(666666);
+ return Long.valueOf(666666);
}
}
@@ -1489,8 +1489,8 @@
while(finalEnum.hasMoreElements())
{
IndexElement ie = (IndexElement)finalEnum.nextElement();
- functionOffsets.add(new Long(ie.offset));
- functionOffsets.add(new Long(ie.count));
+ functionOffsets.add(Long.valueOf(ie.offset));
+ functionOffsets.add(Long.valueOf(ie.count));
}
//System.out.print(" new count: "+functionOffsets.size()+"\n");
/*
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/.classpath Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Carbide.c++ Performance Investigator Graphics Memory Usage
+Bundle-SymbolicName: com.nokia.carbide.cpp.pi.graphicsmemory;singleton:=true
+Bundle-Version: 2.4.0.qualifier
+Bundle-Activator: com.nokia.carbide.cpp.pi.graphicsmemory.GraphicsMemoryPlugin
+Bundle-Vendor: Nokia
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ com.nokia.carbide.cpp.pi,
+ com.nokia.carbide.cpp.pi.util,
+ com.nokia.carbide.cpp.pi.priority,
+ org.eclipse.draw2d
+Bundle-ActivationPolicy: lazy
+Export-Package: com.nokia.carbide.cpp.pi.graphicsmemory;x-friends:="com.nokia.carbide.cpp.pi.graphicsmemory.tests"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/build.properties Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,6 @@
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .
+jars.compile.order = .
+source.. = src/
+output.. = bin/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/plugin.xml Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="com.nokia.carbide.cpp.pi.piPluginData">
+ <plugin pluginClass="com.nokia.carbide.cpp.pi.graphicsmemory.GraphicsMemoryReturnPlugin"/>
+ </extension>
+</plugin>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemoryPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,562 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Hashtable;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.osgi.framework.BundleContext;
+
+import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
+import com.nokia.carbide.cpp.internal.pi.analyser.ProfileReader;
+import com.nokia.carbide.cpp.internal.pi.analyser.ProfileVisualiser;
+import com.nokia.carbide.cpp.internal.pi.model.GenericTrace;
+import com.nokia.carbide.cpp.internal.pi.model.ParsedTraceData;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.AbstractPiPlugin;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.IClassReplacer;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.IEventListener;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.IReportable;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.IViewMenu;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.IVisualizable;
+import com.nokia.carbide.cpp.internal.pi.visual.GenericTraceGraph;
+import com.nokia.carbide.cpp.internal.pi.visual.GraphDrawRequest;
+import com.nokia.carbide.cpp.internal.pi.visual.PIEvent;
+import com.nokia.carbide.cpp.pi.editors.PIPageEditor;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class GraphicsMemoryPlugin extends AbstractPiPlugin implements
+ IViewMenu, ITrace, IClassReplacer, IVisualizable, IEventListener,
+ IReportable {
+ private static final String HELP_CONTEXT_ID = PIPageEditor.PI_ID
+ + ".graphicsmemory"; //$NON-NLS-1$
+ public static final String HELP_CONTEXT_ID_MAIN_PAGE = HELP_CONTEXT_ID
+ + ".graphicsMemoryPageContext"; //$NON-NLS-1$
+
+ public static final String PLUGIN_ID = "com.nokia.carbide.cpp.pi.graphicsmemory"; //$NON-NLS-1$
+
+ // There will be 1 graph for editor page 0
+ // This code may assume that page 0 has the threads graph
+ private final static int GRAPH_COUNT = 3;
+
+ // The shared instance.
+ private static GraphicsMemoryPlugin plugin;
+
+ private static void setPlugin(GraphicsMemoryPlugin newPlugin) {
+ plugin = newPlugin;
+ }
+
+ /**
+ * The constructor.
+ */
+ public GraphicsMemoryPlugin() {
+ super();
+ setPlugin(this);
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ setPlugin(null);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static GraphicsMemoryPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Update menu items
+ */
+ public void updateMenuItems() {
+ int uid = NpiInstanceRepository.getInstance().activeUid();
+ ProfileReader.getInstance().setTraceMenus(
+ NpiInstanceRepository.getInstance().getPlugins(uid), uid);
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path.
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractPiPlugin.imageDescriptorFromPlugin(
+ GraphicsMemoryPlugin.PLUGIN_ID, path); //$NON-NLS-1$
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class getTraceClass() {
+ return GraphicsMemoryTrace.class;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class getReplacedClass(String className) {
+ if (className.indexOf(GraphicsMemoryPlugin.PLUGIN_ID
+ + ".GraphicsMemoryTrace") != -1)//$NON-NLS-1$
+ {
+ return GraphicsMemoryTrace.class;
+ } else if (className.indexOf(GraphicsMemoryPlugin.PLUGIN_ID
+ + ".GraphicsMemorySample") != -1)//$NON-NLS-1$
+ {
+ return GraphicsMemorySample.class;
+ } else if (className
+ .indexOf("[L" + GraphicsMemoryPlugin.PLUGIN_ID + ".GraphicsMemoryProcess") != -1)//$NON-NLS-1$ //$NON-NLS-2$
+ {
+ return GraphicsMemoryProcess[].class;
+ } else if (className.indexOf(GraphicsMemoryPlugin.PLUGIN_ID
+ + ".GraphicsMemoryProcess") != -1)//$NON-NLS-1$
+ {
+ return GraphicsMemoryProcess.class;
+ } else
+ return null;
+ }
+
+ public void initialiseTrace(GenericTrace trace) {
+ if (!(trace instanceof GraphicsMemoryTrace))
+ return;
+
+ GraphicsMemoryTrace memTrace = (GraphicsMemoryTrace) trace;
+
+ NpiInstanceRepository.getInstance().activeUidAddTrace(
+ GraphicsMemoryPlugin.PLUGIN_ID, trace); //$NON-NLS-1$
+
+ memTrace.gatherDrawData();
+
+ System.out.println(Messages
+ .getString("GraphicsMemoryPlugin.traceProcessed")); //$NON-NLS-1$
+ }
+
+ public String getTraceName() {
+ return "GraphicsMemory"; //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceTitle()
+ */
+ public String getTraceTitle() {
+ return Messages.getString("GraphicsMemoryPlugin.1"); //$NON-NLS-1$
+ }
+
+ public int getTraceId() {
+ return 14;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#parseTraceFiles
+ * (java.io.File[])
+ */
+ public ParsedTraceData parseTraceFiles(File[] files) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+
+ public ParsedTraceData parseTraceFile(File file) throws Exception {
+ ParsedTraceData traceData = null;
+ try {
+ GraphicsMemoryTraceParser memParser = new GraphicsMemoryTraceParser();
+ traceData = memParser.parse(file);
+ return traceData;
+ } catch (IOException e) {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ public MenuManager getViewOptionManager() {
+ if (NpiInstanceRepository.getInstance().activeUidGetTrace(
+ GraphicsMemoryPlugin.PLUGIN_ID) == null) //$NON-NLS-1$
+ return null; // no trace, so no MenuManager
+
+ boolean showPrivate = true;
+ boolean showShared = true;
+
+ // if there is a showPrivate value associated with the current Analyser
+ // tab, then use it
+ Object obj;
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showPrivate"); //$NON-NLS-1$
+ if ((obj != null) && (obj instanceof Boolean))
+ // retrieve the current value
+ showPrivate = (Boolean) obj;
+ else
+ // set the initial value
+ NpiInstanceRepository
+ .getInstance()
+ .activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showPrivate", showPrivate); //$NON-NLS-1$
+
+ // if there is a showShared value associated with the current
+ // Analyser tab, then use it
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showShared"); //$NON-NLS-1$
+ if ((obj != null) && (obj instanceof Boolean))
+ // retrieve the current value
+ showShared = (Boolean) obj;
+ else
+ // set the initial value
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showShared", showShared); //$NON-NLS-1$
+
+ Action action;
+
+ MenuManager manager = new MenuManager(Messages
+ .getString("GraphicsMemoryPlugin.graphicsMemoryGraph")); //$NON-NLS-1$
+
+ action = new Action(
+ Messages.getString("GraphicsMemoryPlugin.memoryStats"), Action.AS_PUSH_BUTTON) { //$NON-NLS-1$
+ public void run() {
+ new GraphicsMemoryStatisticsDialog(Display.getCurrent());
+ }
+ };
+
+ action.setToolTipText(Messages
+ .getString("GraphicsMemoryPlugin.memoryStatsTooltip")); //$NON-NLS-1$
+ manager.add(action);
+
+ manager.add(new Separator());
+
+ action = new Action(
+ Messages.getString("GraphicsMemoryPlugin.showPrivate"), Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
+ public void run() {
+ if (this.isChecked())
+ receiveSelectionEvent("private_on"); //$NON-NLS-1$
+ }
+ };
+ action.setChecked(showPrivate && !showShared);
+ action.setToolTipText(Messages
+ .getString("GraphicsMemoryPlugin.showPrivateTooltip")); //$NON-NLS-1$
+ manager.add(action);
+
+ action = new Action(
+ Messages.getString("GraphicsMemoryPlugin.showShared"), Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
+ public void run() {
+ if (this.isChecked())
+ receiveSelectionEvent("shared_on"); //$NON-NLS-1$
+ }
+ };
+ action.setChecked(showShared && !showPrivate);
+ action.setToolTipText(Messages
+ .getString("GraphicsMemoryPlugin.showSharedTooltip")); //$NON-NLS-1$
+ manager.add(action);
+
+ action = new Action(
+ Messages.getString("GraphicsMemoryPlugin.showAll"), Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
+ public void run() {
+ if (this.isChecked())
+ receiveSelectionEvent("private_shared_on"); //$NON-NLS-1$
+ }
+ };
+ action.setChecked(showPrivate && showShared);
+ action.setToolTipText(Messages
+ .getString("GraphicsMemoryPlugin.showAllTooltip")); //$NON-NLS-1$
+ manager.add(action);
+
+ manager.add(new Separator());
+
+ boolean rescale = false;
+
+ // if there is a rescale value associated with the current Analyser tab,
+ // then use it
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".rescale"); //$NON-NLS-1$
+ if ((obj != null) && (obj instanceof Boolean))
+ // retrieve the current value
+ rescale = (Boolean) obj;
+ else
+ // set the initial value
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".rescale", rescale); //$NON-NLS-1$
+
+ action = new Action(
+ Messages.getString("GraphicsMemoryPlugin.dynamicRescale"), Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ if (this.isChecked())
+ receiveSelectionEvent("rescale_on"); //$NON-NLS-1$
+ else
+ receiveSelectionEvent("rescale_off"); //$NON-NLS-1$
+ }
+ };
+ action.setChecked(rescale);
+ action.setToolTipText(Messages
+ .getString("GraphicsMemoryPlugin.dynamicRescaleTooltip")); //$NON-NLS-1$
+ manager.add(action);
+
+ boolean showMemoryUsageLine = true;
+ // if there is a show memory usage value associated with the current
+ // Analyser tab, then use it
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showMemoryUsage"); //$NON-NLS-1$
+ if ((obj != null) && (obj instanceof Boolean))
+ // retrieve the current value
+ showMemoryUsageLine = (Boolean) obj;
+ else
+ // set the initial value
+ NpiInstanceRepository
+ .getInstance()
+ .activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showMemoryUsage", showMemoryUsageLine); //$NON-NLS-1$
+
+ action = new Action(
+ Messages
+ .getString("GraphicsMemoryTraceGraph.showTotalMemoryUsage"), Action.AS_CHECK_BOX) { //$NON-NLS-1$
+ public void run() {
+ if (this.isChecked())
+ receiveSelectionEvent("memory_usage_line_on"); //$NON-NLS-1$
+ else
+ receiveSelectionEvent("memory_usage_line_off"); //$NON-NLS-1$
+ }
+ };
+ action.setChecked(showMemoryUsageLine);
+ action.setToolTipText(Messages
+ .getString("GraphicsMemoryPlugin.showTotalMemoryUsageToolTip")); //$NON-NLS-1$
+ manager.add(action);
+
+ return manager;
+ }
+
+ public void receiveEvent(String actionString, Event event) {
+ GraphicsMemoryTrace trace = (GraphicsMemoryTrace) NpiInstanceRepository
+ .getInstance()
+ .activeUidGetTrace(GraphicsMemoryPlugin.PLUGIN_ID); //$NON-NLS-1$
+
+ if (trace == null)
+ return;
+
+ if (actionString.equals("private_on") //$NON-NLS-1$
+ || actionString.equals("shared_on") //$NON-NLS-1$
+ || actionString.equals("private_shared_on") //$NON-NLS-1$
+ || actionString.equals("rescale_on") //$NON-NLS-1$
+ || actionString.equals("rescale_off")) //$NON-NLS-1$
+ {
+ ((GraphicsMemoryTraceGraph) trace
+ .getTraceGraph(PIPageEditor.THREADS_PAGE))
+ .action(actionString);
+ ((GraphicsMemoryTraceGraph) trace
+ .getTraceGraph(PIPageEditor.BINARIES_PAGE))
+ .action(actionString);
+ ((GraphicsMemoryTraceGraph) trace
+ .getTraceGraph(PIPageEditor.FUNCTIONS_PAGE))
+ .action(actionString);
+ } else if (actionString.equals("scroll")) //$NON-NLS-1$
+ {
+ PIEvent be = new PIEvent(event, PIEvent.SCROLLED);
+
+ ((GraphicsMemoryTraceGraph) trace
+ .getTraceGraph(PIPageEditor.THREADS_PAGE))
+ .piEventReceived(be);
+ ((GraphicsMemoryTraceGraph) trace
+ .getTraceGraph(PIPageEditor.BINARIES_PAGE))
+ .piEventReceived(be);
+ ((GraphicsMemoryTraceGraph) trace
+ .getTraceGraph(PIPageEditor.FUNCTIONS_PAGE))
+ .piEventReceived(be);
+ }
+ }
+
+ public void receiveSelectionEvent(String actionString) {
+ if (actionString == null)
+ return;
+
+ if (actionString.equals("private_on")) { //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showPrivate", true); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showShared", false); //$NON-NLS-1$
+ } else if (actionString.equals("shared_on")) { //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showPrivate", false); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showShared", true); //$NON-NLS-1$
+ } else if (actionString.equals("private_shared_on")) { //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showPrivate", true); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showShared", true); //$NON-NLS-1$
+ } else if (actionString.equals("rescale_on")) { //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".rescale", true); //$NON-NLS-1$
+ } else if (actionString.equals("rescale_off")) { //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".rescale", false); //$NON-NLS-1$
+ } else if (actionString.equals("memory_usage_line_on")) { //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showMemoryUsage", true); //$NON-NLS-1$
+ } else if (actionString.equals("memory_usage_line_off")) { //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showMemoryUsage", false); //$NON-NLS-1$
+ } else {
+ return;
+ }
+
+ ((GraphicsMemoryTraceGraph) this
+ .getTraceGraph(PIPageEditor.THREADS_PAGE)).action(actionString);
+ ((GraphicsMemoryTraceGraph) this
+ .getTraceGraph(PIPageEditor.BINARIES_PAGE))
+ .action(actionString);
+ ((GraphicsMemoryTraceGraph) this
+ .getTraceGraph(PIPageEditor.FUNCTIONS_PAGE))
+ .action(actionString);
+ }
+
+ public GenericTraceGraph getTraceGraph(int graphIndex) {
+ GraphicsMemoryTrace trace = (GraphicsMemoryTrace) NpiInstanceRepository
+ .getInstance()
+ .activeUidGetTrace(GraphicsMemoryPlugin.PLUGIN_ID); //$NON-NLS-1$
+
+ if (trace != null)
+ return trace.getTraceGraph(graphIndex);
+ else
+ return null;
+ }
+
+ public Integer getLastSample(int graphIndex) {
+ GraphicsMemoryTrace trace = (GraphicsMemoryTrace) NpiInstanceRepository
+ .getInstance()
+ .activeUidGetTrace(GraphicsMemoryPlugin.PLUGIN_ID); //$NON-NLS-1$
+
+ if (trace != null)
+ return Integer.valueOf(trace.getLastSampleNumber());
+ else
+ return null;
+ }
+
+ public Hashtable<Integer, Object> getSummaryTable(double start, double end) {
+ return null;
+ }
+
+ public String getGeneralInfo() {
+ return null;
+ }
+
+ public ArrayList<String> getColumnNames() {
+ ArrayList<String> names = new ArrayList<String>();
+ names.add(Messages.getString("GraphicsMemoryPlugin.namesProcess")); //$NON-NLS-1$
+ names.add(Messages.getString("GraphicsMemoryPlugin.namesAvgPrivate")); //$NON-NLS-1$
+ names.add(Messages.getString("GraphicsMemoryPlugin.namesAvgShared")); //$NON-NLS-1$
+ names.add(Messages.getString("GraphicsMemoryPlugin.namesTotal")); //$NON-NLS-1$
+ return names;
+ }
+
+ public ArrayList<Boolean> getColumnSortTypes() {
+ ArrayList<Boolean> sortTypes = new ArrayList<Boolean>();
+ sortTypes.add(SORT_BY_NAME);
+ sortTypes.add(SORT_BY_NUMBER);
+ sortTypes.add(SORT_BY_NUMBER);
+ sortTypes.add(SORT_BY_NUMBER);
+ return sortTypes;
+ }
+
+ public String getActiveInfo(Object arg0, double startTime, double endTime) {
+ return null;
+ }
+
+ public MenuManager getReportGeneratorManager() {
+ return null;
+ }
+
+ public GraphDrawRequest getDrawRequest(int graphIndex) {
+ return null;
+ }
+
+ public int getGraphCount() {
+ return GRAPH_COUNT;
+ }
+
+ public int getPageNumber(int graphIndex) {
+ // Assumes page 0 has the threads graph, 1 has the binaries, and 2 has
+ // the functions
+ if (graphIndex == 0)
+ return PIPageEditor.THREADS_PAGE;
+ else if (graphIndex == 1)
+ return PIPageEditor.BINARIES_PAGE;
+ else if (graphIndex == 2)
+ return PIPageEditor.FUNCTIONS_PAGE;
+
+ return PIPageEditor.NEXT_AVAILABLE_PAGE;
+ }
+
+ // return whether this plugin's editor pages have been created
+ public boolean arePagesCreated() {
+ return false;
+ }
+
+ public void setPagesCreated(boolean pagesCreated) {
+ return;
+ }
+
+ public int getCreatePageCount() {
+ return 0;
+ }
+
+ public int getCreatePageIndex(int index) {
+ return 0;
+ }
+
+ public ProfileVisualiser createPage(int index) {
+ return null;
+ }
+
+ public void setPageIndex(int index, int pageIndex) {
+ return;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemoryProcess.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import com.nokia.carbide.cpp.internal.pi.model.GenericThread;
+
+public class GraphicsMemoryProcess extends GenericThread {
+ private static final long serialVersionUID = -3170239590768930245L;
+
+ // name to be shown for the process
+ transient public String fullName;
+
+ // maximum memory usage of process within the current time interval
+ transient public MaxGraphicsMemoryItem maxMemoryItem;
+
+ // remember whether the process is enabled for the given graph
+ transient public boolean[] enabled;
+
+ public GraphicsMemoryProcess(Integer processId, String processName) {
+ this.processId = processId;
+ this.processName = processName;
+ }
+
+ // get whether the process is enabled for the given graph
+ public boolean isEnabled(int graphIndex) {
+ return this.enabled[graphIndex];
+ }
+
+ // set whether the process is enabled for the given graph
+ public void setEnabled(int graphIndex, boolean enabled) {
+ this.enabled[graphIndex] = enabled;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemoryProcessTable.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,874 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.ActionEvent;
+import java.awt.event.FocusEvent;
+import java.awt.event.MouseEvent;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.Vector;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.SubMenuManager;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.ide.IIDEActionConstants;
+
+import com.nokia.carbide.cpp.internal.pi.interfaces.ISaveSamples;
+import com.nokia.carbide.cpp.internal.pi.visual.GenericTable;
+import com.nokia.carbide.cpp.internal.pi.visual.PIEvent;
+import com.nokia.carbide.cpp.pi.editors.PIPageEditor;
+
+public class GraphicsMemoryProcessTable extends GenericTable {
+ private static final int COLUMN_ID_GRAPHICS_MEMORY_PRIVATE = 14;
+ private static final int COLUMN_ID_GRAPHICS_MEMORY_SHARED = 15;
+ private static final int COLUMN_ID_GRAPHICS_MEMORY_TOTAL = 16;
+ private static final int COLUMN_ID_GRAPHICS_MEMORY_NAME = 17;
+
+ // sort direction
+ private boolean sortAscending = true;
+
+ private GraphicsMemoryTraceGraph myGraph;
+ private Composite parent;
+
+ // override
+ protected Vector<GraphicsMemoryProcess> tableItemData;
+
+ // menu items
+ private Action selectAllAction;
+ private Action copyTableAction;
+ private Action copyAction;
+ private Action saveTableAction;
+
+ // class to pass sample data to the save wizard
+ public class SaveSampleString implements ISaveSamples {
+ boolean done = false;
+
+ public SaveSampleString() {
+ }
+
+ public String getData() {
+ if (done)
+ return null;
+
+ String returnString = getSampleString();
+ done = true;
+ return returnString;
+ }
+
+ public String getData(int size) {
+ return getData();
+ }
+
+ public int getIndex() {
+ return done ? 1 : 0;
+ }
+
+ public void clear() {
+ done = false;
+ }
+ }
+
+ /*
+ * return the graphics memory samples selected in the interval
+ */
+ protected String getSampleString() {
+ int startTime = (int) (PIPageEditor.currentPageEditor().getStartTime() * 1000.0 + 0.0005);
+ int endTime = (int) (PIPageEditor.currentPageEditor().getEndTime() * 1000.0 + 0.0005);
+
+ GraphicsMemoryTrace trace = this.myGraph.getMemTrace();
+ String returnString = Messages
+ .getString("GraphicsMemoryProcessTable.saveSamplesHeading"); //$NON-NLS-1$
+ if (trace.getVersion() == 100) {
+ TreeMap<Long, ArrayList<GraphicsMemorySample>> sorted = new TreeMap<Long, ArrayList<GraphicsMemorySample>>();
+ Enumeration<TreeMap<Long, GraphicsMemorySample>> enume = trace
+ .getDrawDataByMemProcess().elements();
+ while (enume.hasMoreElements()) {
+ TreeMap<Long, GraphicsMemorySample> map = enume.nextElement();
+ Iterator<GraphicsMemorySample> iterator = map.values()
+ .iterator();
+ while (iterator.hasNext()) {
+ GraphicsMemorySample memSample = iterator.next();
+ if(memSample.process.isEnabled(myGraph.getGraphIndex()) && !memSample.process.fullName
+ .equals(GraphicsMemoryTraceParser.SAMPLE_TOTAL_MEMORY_PROCESS_NAME)){
+ ArrayList<GraphicsMemorySample> memList = sorted
+ .get(memSample.sampleSynchTime);
+ if (memList == null) {
+ memList = new ArrayList<GraphicsMemorySample>();
+ }
+ memList.add(memSample);
+ sorted.put(memSample.sampleSynchTime, memList);
+ }else{
+ break;
+ }
+ }
+ }
+
+ SortedMap<Long, ArrayList<GraphicsMemorySample>> selectionAreaMap = sorted
+ .subMap((long) startTime, (long) endTime);
+ Iterator<ArrayList<GraphicsMemorySample>> iterator = selectionAreaMap
+ .values().iterator();
+
+ while (iterator.hasNext()) {
+ ArrayList<GraphicsMemorySample> memSamples = iterator.next();
+ for (GraphicsMemorySample memSample : memSamples) {
+ returnString += memSample.sampleSynchTime
+ + Messages
+ .getString("GraphicsMemoryProcessTable.comma") //$NON-NLS-1$
+ + memSample.process.fullName
+ + Messages
+ .getString("GraphicsMemoryProcessTable.comma") //$NON-NLS-1$
+ + ((memSample.privateSize + 512) / 1024)
+ + Messages
+ .getString("GraphicsMemoryProcessTable.comma") //$NON-NLS-1$
+ + ((memSample.sharedSize + 512) / 1024) + "\n"; //$NON-NLS-1$
+ }
+ }
+ }
+ return returnString;
+ }
+
+ protected MenuItem getSaveSamplesItem(Menu menu, boolean enabled) {
+ MenuItem saveSamplesItem = new MenuItem(menu, SWT.PUSH);
+
+ saveSamplesItem.setText(Messages
+ .getString("GraphicsMemoryProcessTable.saveCheckedSamples")); //$NON-NLS-1$
+ saveSamplesItem.setEnabled(enabled);
+
+ if (enabled) {
+ saveSamplesItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ action("saveSamples"); //$NON-NLS-1$
+ }
+ });
+ }
+
+ return saveSamplesItem;
+ }
+
+ public GraphicsMemoryProcessTable(GraphicsMemoryTraceGraph myGraph,
+ Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gl = new GridLayout();
+ gl.marginHeight = 0;
+ gl.marginWidth = 0;
+ gl.marginLeft = 0;
+ gl.marginRight = 0;
+ composite.setLayout(gl);
+ this.myGraph = myGraph;
+ this.parent = composite;
+
+ Label label = new Label(composite, SWT.CENTER);
+ label.setBackground(composite.getDisplay().getSystemColor(
+ SWT.COLOR_WHITE));
+ label.setFont(PIPageEditor.helvetica_8);
+ label.setText(Messages.getString("GraphicsMemoryProcessTable.title")); //$NON-NLS-1$
+
+ label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ this.tableViewer = CheckboxTableViewer.newCheckList(composite,
+ SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL
+ | SWT.FULL_SELECTION);
+ this.table = this.tableViewer.getTable();
+ this.table.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ // add the check state handler, label provider and content provider
+ this.tableViewer.addCheckStateListener(new CheckHandler());
+ this.tableViewer.setLabelProvider(new SharedLabelProvider(this.table));
+ this.tableViewer.setContentProvider(new MemoryTableContentProvider());
+ this.tableViewer.setSorter(new SharedSorter());
+
+ // give the table a heading for possible use in copying and exported
+ this.table.setData(Messages
+ .getString("GraphicsMemoryProcessTable.memory")); //$NON-NLS-1$
+
+ // create the columns
+ TableColumn column;
+
+ // data associated with the TableViewer will note which columns contain
+ // hex values
+ // Keep this in the order in which columns have been created
+ boolean[] isHex = { false, false, false, false };
+ this.table.setData("isHex", isHex); //$NON-NLS-1$
+
+ // select/deselect column
+ column = new TableColumn(this.table, SWT.CENTER);
+ column.setText(COLUMN_HEAD_GRAPHICS_MEMORY_NAME);
+ column.setWidth(COLUMN_WIDTH_GRAPHICS_MEMORY_NAME);
+ column.setData(Integer.valueOf(COLUMN_ID_GRAPHICS_MEMORY_NAME));
+ column.setMoveable(true);
+ column.setResizable(true);
+ column.addSelectionListener(new ColumnSelectionHandler());
+
+ column = new TableColumn(tableViewer.getTable(), SWT.RIGHT);
+ column.setText(COLUMN_HEAD_GRAPHICS_MEMORY_PRIVATE);
+ column.setWidth(COLUMN_WIDTH_GRAPHICS_MEMORY_PRIVATE);
+ column.setData(Integer.valueOf(COLUMN_ID_GRAPHICS_MEMORY_PRIVATE));
+ column.setMoveable(true);
+ column.setResizable(true);
+ column.addSelectionListener(new ColumnSelectionHandler());
+
+ column = new TableColumn(tableViewer.getTable(), SWT.RIGHT);
+ column.setText(COLUMN_HEAD_GRAPHICS_MEMORY_SHARED);
+ column.setWidth(COLUMN_WIDTH_GRAPHICS_MEMORY_SHARED);
+ column.setData(Integer.valueOf(COLUMN_ID_GRAPHICS_MEMORY_SHARED));
+ column.setMoveable(true);
+ column.setResizable(true);
+ column.addSelectionListener(new ColumnSelectionHandler());
+
+ column = new TableColumn(tableViewer.getTable(), SWT.RIGHT);
+ column.setText(COLUMN_HEAD_MEMORY_TOTAL);
+ column.setWidth(COLUMN_WIDTH_MEMORY_TOTAL);
+ column.setData(Integer.valueOf(COLUMN_ID_GRAPHICS_MEMORY_TOTAL));
+ column.setMoveable(true);
+ column.setResizable(true);
+ column.addSelectionListener(new ColumnSelectionHandler());
+
+ // initially, all rows are checked
+ this.tableViewer.setAllChecked(true);
+
+ this.table.addMouseListener(new TableMouseListener());
+ this.table.setHeaderVisible(true);
+ this.table.setLinesVisible(true);
+ this.table.setRedraw(true);
+
+ updateItemData(true);
+ ((SharedSorter) tableViewer.getSorter())
+ .doSort(COLUMN_ID_GRAPHICS_MEMORY_NAME);
+
+ // initially, all rows are checked
+ this.tableViewer.setAllChecked(true);
+
+ createDefaultActions();
+
+ // listen for key sequences such as Ctrl-A and Ctrl-C
+ table.addKeyListener(new TableKeyListener());
+
+ table.addFocusListener(new FocusListener() {
+ IAction oldSelectAllAction = null;
+ IAction oldCopyAction = null;
+
+ public void focusGained(org.eclipse.swt.events.FocusEvent arg0) {
+ IActionBars bars = PIPageEditor.getActionBars();
+
+ oldSelectAllAction = PIPageEditor.getActionBars()
+ .getGlobalActionHandler(
+ ActionFactory.SELECT_ALL.getId());
+ oldCopyAction = PIPageEditor.getActionBars()
+ .getGlobalActionHandler(ActionFactory.COPY.getId());
+
+ bars.setGlobalActionHandler(ActionFactory.COPY.getId(),
+ copyAction);
+ bars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(),
+ selectAllAction);
+
+ copyAction.setEnabled(table.getSelectionCount() > 0);
+ selectAllAction.setEnabled(table.getItemCount() > 0);
+ bars.updateActionBars();
+
+ // add to the Edit menu
+ IMenuManager editMenuManager = bars.getMenuManager()
+ .findMenuUsingPath(IIDEActionConstants.M_EDIT);
+
+ if (editMenuManager instanceof SubMenuManager) {
+ IContributionManager editManager = ((SubMenuManager) editMenuManager)
+ .getParent();
+ ActionContributionItem item;
+
+ editMenuManager.remove("PICopyTable"); //$NON-NLS-1$
+ copyTableAction.setEnabled(table.getItemCount() > 0);
+ item = new ActionContributionItem(copyTableAction);
+ item.setVisible(true);
+ editManager.prependToGroup(IIDEActionConstants.CUT_EXT,
+ item);
+ }
+
+ // add to the File menu
+ IMenuManager fileMenuManager = bars.getMenuManager()
+ .findMenuUsingPath(IIDEActionConstants.M_FILE);
+
+ if (fileMenuManager instanceof SubMenuManager) {
+ IContributionManager fileManager = ((SubMenuManager) fileMenuManager)
+ .getParent();
+ ActionContributionItem item;
+
+ fileMenuManager.remove("PISaveTable"); //$NON-NLS-1$
+ saveTableAction.setEnabled(table.getItemCount() > 0);
+ item = new ActionContributionItem(saveTableAction);
+ item.setVisible(true);
+ fileManager.insertAfter("saveAll", item); //$NON-NLS-1$
+ }
+ }
+
+ public void focusLost(org.eclipse.swt.events.FocusEvent arg0) {
+ IActionBars bars = PIPageEditor.getActionBars();
+ bars.setGlobalActionHandler(ActionFactory.COPY.getId(),
+ oldCopyAction);
+ bars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(),
+ oldSelectAllAction);
+ bars.updateActionBars();
+
+ SubMenuManager editMenuManager = (SubMenuManager) PIPageEditor
+ .getMenuManager().find(IIDEActionConstants.M_EDIT);
+ editMenuManager.remove("PICopyTable"); //$NON-NLS-1$
+ editMenuManager.update();
+
+ SubMenuManager fileMenuManager = (SubMenuManager) PIPageEditor
+ .getMenuManager().find(IIDEActionConstants.M_FILE);
+ fileMenuManager.remove("PISaveTable"); //$NON-NLS-1$
+ fileMenuManager.update();
+ }
+ });
+
+ tableViewer.refresh();
+ table.redraw();
+ }
+
+ private class TableMouseListener implements MouseListener {
+ public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e) {
+ if (e.button == MouseEvent.BUTTON1) {
+ TableItem[] selectedItems = table.getSelection();
+ if (selectedItems.length == 0)
+ return;
+
+ if (selectedItems[0].getData() instanceof GraphicsMemoryProcess) {
+ GraphicsMemoryProcess memProcess = (GraphicsMemoryProcess) (selectedItems[0]
+ .getData());
+ if (memProcess.isEnabled(myGraph.getGraphIndex()))
+ action("remove"); //$NON-NLS-1$
+ else
+ action("add"); //$NON-NLS-1$
+ }
+ }
+ selectAllAction.setEnabled(table.getItemCount() > 0);
+ copyAction.setEnabled(table.getSelectionCount() > 0);
+ copyTableAction.setEnabled(table.getItemCount() > 0);
+ }
+
+ public void mouseDown(org.eclipse.swt.events.MouseEvent e) {
+ }
+
+ public void mouseUp(org.eclipse.swt.events.MouseEvent e) {
+
+ selectAllAction.setEnabled(table.getItemCount() > 0);
+ copyAction.setEnabled(table.getSelectionCount() > 0);
+ copyTableAction.setEnabled(table.getItemCount() > 0);
+
+ if (e.button == MouseEvent.BUTTON3) {
+ // get rid of last Menu created so we don't have double menu
+ // on click
+ if (contextMenu != null) {
+ contextMenu.dispose();
+ }
+
+ contextMenu = new Menu(table.getShell(), SWT.POP_UP);
+ getCheckRows(contextMenu, table.getSelectionCount() > 0);
+
+ // select all, copy, and copy all
+ new MenuItem(contextMenu, SWT.SEPARATOR);
+ getSelectAllItem(contextMenu, table.getItemCount() > 0);
+ getCopyItem(contextMenu, table.getSelectionCount() > 0);
+ getCopyTableItem(contextMenu, table.getItemCount() > 0);
+ selectAllAction.setEnabled(table.getItemCount() > 0);
+ copyAction.setEnabled(table.getSelectionCount() > 0);
+ copyTableAction.setEnabled(table.getItemCount() > 0);
+
+ // save all
+ new MenuItem(contextMenu, SWT.SEPARATOR);
+ getSaveTableItem(contextMenu, table.getItemCount() > 0);
+ saveTableAction.setEnabled(table.getItemCount() > 0);
+
+ // save samples
+ int startTime = (int) (PIPageEditor.currentPageEditor()
+ .getStartTime() * 1000.0f);
+ int endTime = (int) (PIPageEditor.currentPageEditor()
+ .getEndTime() * 1000.0f);
+
+ getSaveSamplesItem(contextMenu, myGraph.haveEnabled()
+ && (startTime != -1) && (endTime != -1)
+ && (startTime != endTime));
+
+ contextMenu.setLocation(parent.toDisplay(e.x
+ + table.getLocation().x, e.y + table.getLocation().y));
+ contextMenu.setVisible(true);
+
+ new MenuItem(contextMenu, SWT.SEPARATOR);
+
+ MenuItem memoryStatsItem = new MenuItem(contextMenu, SWT.PUSH);
+ memoryStatsItem.setText(Messages
+ .getString("GraphicsMemoryPlugin.memoryStats")); //$NON-NLS-1$
+ memoryStatsItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ new GraphicsMemoryStatisticsDialog(Display.getCurrent());
+ }
+ });
+
+ table.setMenu(contextMenu);
+ }
+ }
+ }
+
+ private static class MemoryTableContentProvider implements
+ IStructuredContentProvider {
+
+ public MemoryTableContentProvider() {
+ super();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object[] getElements(Object inputElement) {
+ return ((Vector<GraphicsMemoryProcess>) inputElement).toArray();
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+ }
+
+ private class CheckHandler implements ICheckStateListener {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+
+ if (!(event.getElement() instanceof GraphicsMemoryProcess))
+ return;
+
+ // set the stored value to the checkbox value
+ GraphicsMemoryProcess memProcess = (GraphicsMemoryProcess) event
+ .getElement();
+ memProcess.setEnabled(myGraph.getGraphIndex(), event.getChecked());
+
+ selectionChangeNotify();
+
+ table.deselectAll();
+ }
+ }
+
+ void selectionChangeNotify() {
+ this.tableViewer.refresh();
+ this.table.redraw();
+ PIEvent be = new PIEvent(null, PIEvent.CHANGED_MEMORY_TABLE);
+ myGraph.piEventReceived(be);
+ }
+
+ private class SharedLabelProvider extends LabelProvider implements
+ ITableLabelProvider {
+
+ private DecimalFormat decimalFormat = new DecimalFormat(Messages
+ .getString("GraphicsMemoryProcessTable.kbFormat")); //$NON-NLS-1$
+
+ Table table;
+
+ public SharedLabelProvider(Table table) {
+ super();
+ this.table = table;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ int columnId = ((Integer) table.getColumn(columnIndex).getData())
+ .intValue();
+
+ if (!(element instanceof GraphicsMemoryProcess))
+ return ""; //$NON-NLS-1$
+
+ GraphicsMemoryProcess profiledItem = (GraphicsMemoryProcess) element;
+
+ switch (columnId) {
+ case COLUMN_ID_GRAPHICS_MEMORY_NAME: {
+ return profiledItem.fullName;
+ }
+ case COLUMN_ID_GRAPHICS_MEMORY_PRIVATE: {
+ double startTime = PIPageEditor.currentPageEditor()
+ .getStartTime();
+ double endTime = PIPageEditor.currentPageEditor().getEndTime();
+
+ if ((startTime == -1) || (endTime == -1)
+ || (startTime == endTime))
+ return ""; //$NON-NLS-1$
+
+ return decimalFormat
+ .format((profiledItem.maxMemoryItem.maxPrivate + 512) / 1024);
+ }
+ case COLUMN_ID_GRAPHICS_MEMORY_SHARED: {
+ double startTime = PIPageEditor.currentPageEditor()
+ .getStartTime();
+ double endTime = PIPageEditor.currentPageEditor().getEndTime();
+
+ if ((startTime == -1) || (endTime == -1)
+ || (startTime == endTime))
+ return ""; //$NON-NLS-1$
+
+ return decimalFormat
+ .format((profiledItem.maxMemoryItem.maxShared + 512) / 1024);
+ }
+ case COLUMN_ID_GRAPHICS_MEMORY_TOTAL: {
+ double startTime = PIPageEditor.currentPageEditor()
+ .getStartTime();
+ double endTime = PIPageEditor.currentPageEditor().getEndTime();
+
+ if ((startTime == -1) || (endTime == -1)
+ || (startTime == endTime))
+ return ""; //$NON-NLS-1$
+
+ return decimalFormat
+ .format((profiledItem.maxMemoryItem.maxTotal + 512) / 1024);
+ }
+ default: {
+ break;
+ }
+ }
+ // should never get here
+ return ""; //$NON-NLS-1$
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+ }
+
+ /*
+ * TableViewer sorter for the called-by and called function tableviewers
+ */
+ private class SharedSorter extends ViewerSorter {
+ // last column sorted
+ private int column = -1;
+
+ /*
+ * decide on which column to sort by, and the sort ordering
+ */
+ public void doSort(int column) {
+ // ignore the column passed in and use the id set by the column
+ // selection handler
+ if (column == this.column) {
+ // sort in other order
+ sortAscending = !sortAscending;
+ } else {
+ // changed columns, so sort in the default order
+ switch (column) {
+ case COLUMN_ID_GRAPHICS_MEMORY_NAME: {
+ // sort in ascending order
+ sortAscending = true;
+ break;
+ }
+ case COLUMN_ID_GRAPHICS_MEMORY_PRIVATE:
+ case COLUMN_ID_GRAPHICS_MEMORY_SHARED:
+ case COLUMN_ID_GRAPHICS_MEMORY_TOTAL: {
+ // sort in descending order
+ sortAscending = false;
+ break;
+ }
+ default: {
+ // ignore the column
+ return;
+ }
+ }
+ this.column = column;
+ }
+
+ // find the TableColumn corresponding to column, and give it a
+ // column direction
+ TableColumn sortByColumn = null;
+ for (int i = 0; i < table.getColumnCount(); i++) {
+ if (table.getColumn(i).getData() instanceof Integer) {
+ if (((Integer) table.getColumn(i).getData()) == column) {
+ sortByColumn = table.getColumn(i);
+ break;
+ }
+ }
+ }
+
+ if (sortByColumn != null) {
+ table.setSortColumn(sortByColumn);
+ table.setSortDirection(sortAscending ? SWT.UP : SWT.DOWN);
+ }
+ }
+
+ /*
+ * compare two items from a table column
+ */
+ @SuppressWarnings("unchecked")
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ int returnCode = 0;
+
+ GraphicsMemoryProcess elem1 = (GraphicsMemoryProcess) e1;
+ GraphicsMemoryProcess elem2 = (GraphicsMemoryProcess) e2;
+
+ // find the memory information for the two processes
+
+ // compare based on the memory information
+ switch (column) {
+ case COLUMN_ID_GRAPHICS_MEMORY_PRIVATE:
+
+ returnCode = elem1.maxMemoryItem.maxPrivate > elem2.maxMemoryItem.maxPrivate ? 1
+ : -1;
+ break;
+ case COLUMN_ID_GRAPHICS_MEMORY_SHARED:
+ returnCode = elem1.maxMemoryItem.maxShared > elem2.maxMemoryItem.maxShared ? 1
+ : -1;
+ break;
+ case COLUMN_ID_GRAPHICS_MEMORY_TOTAL:
+ returnCode = elem1.maxMemoryItem.maxTotal > elem2.maxMemoryItem.maxTotal ? 1
+ : -1;
+ break;
+ case COLUMN_ID_GRAPHICS_MEMORY_NAME: {
+ returnCode = this.getComparator().compare(elem1.fullName,
+ elem2.fullName);
+ break;
+ }
+ default:
+ break;
+ }
+
+ // for descending order, reverse the sense of the compare
+ if (!sortAscending)
+ returnCode = -returnCode;
+
+ return returnCode;
+ }
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ }
+
+ public void action(String actionString) {
+ int graphIndex = this.myGraph.getGraphIndex();
+
+ if (actionString.equals("add") //$NON-NLS-1$
+ || actionString.equals("remove")) //$NON-NLS-1$
+ {
+ actionAddRemove(actionString, graphIndex);
+ } else if (actionString.equals("addall") //$NON-NLS-1$
+ || actionString.equals("removeall")) //$NON-NLS-1$
+ {
+ actionAddRemoveAll(actionString, graphIndex);
+ } else if (actionString.equals("copy")) //$NON-NLS-1$
+ {
+ actionCopyOrSave(true, this.table, CHECKBOX_TEXT, false, "\t", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ return; // no redraw needed
+ } else if (actionString.equals("copyTable")) //$NON-NLS-1$
+ {
+ actionCopyOrSave(true, this.table, CHECKBOX_TEXT, true, "\t", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ return; // no redraw needed
+ } else if (actionString.equals("selectAll")) //$NON-NLS-1$
+ {
+ actionSelectAll();
+ return;
+ } else if (actionString.equals("saveTable")) //$NON-NLS-1$
+ {
+ actionCopyOrSave(false, this.table, CHECKBOX_TEXT, true, ",", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ return; // no redraw needed
+ } else if (actionString.equals("saveSamples")) //$NON-NLS-1$
+ {
+ SaveSampleString saveSampleString = new SaveSampleString();
+ actionSaveSamples(saveSampleString); //$NON-NLS-1$
+ return;
+ } else if (actionString.equals("saveTableTest")) //$NON-NLS-1$
+ {
+ // copy save file contents to the clipboard for easy viewing
+ Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
+ SaveTableString getString = new SaveTableString(this.table,
+ CHECKBOX_TEXT, ",", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ String copyString = getString.getData();
+ StringSelection contents = new StringSelection(copyString);
+ cb.setContents(contents, contents);
+ return;
+ }
+
+ tableViewer.refresh();
+ table.redraw();
+ this.myGraph.repaint();
+ }
+
+ private void actionAddRemove(String actionString, int graphIndex) {
+ GraphicsMemoryProcess memProcess;
+
+ // true for "add", false for "remove"
+ boolean addIt = actionString.equals("add"); //$NON-NLS-1$
+
+ TableItem[] selectedItems = this.table.getSelection();
+ for (int i = 0; i < selectedItems.length; i++) {
+ selectedItems[i].setChecked(addIt);
+ memProcess = (GraphicsMemoryProcess) ((TableItem) selectedItems[i])
+ .getData();
+ memProcess.setEnabled(graphIndex, addIt);
+ }
+
+ // this table's set of checkbox-selected rows has changed,
+ // so propagate that information
+ if (selectedItems.length != 0)
+ selectionChangeNotify();
+
+ this.table.deselectAll();
+ }
+
+ private void actionAddRemoveAll(String actionString, int graphIndex) {
+ GraphicsMemoryProcess memProcess;
+
+ // true for "add", false for "remove"
+ boolean addIt = actionString.equals("addall"); //$NON-NLS-1$
+
+ TableItem[] selectedItems = this.table.getItems();
+ for (int i = 0; i < selectedItems.length; i++) {
+ selectedItems[i].setChecked(addIt);
+ memProcess = (GraphicsMemoryProcess) ((TableItem) selectedItems[i])
+ .getData();
+ memProcess.setEnabled(graphIndex, addIt);
+ }
+
+ // this table's set of checkbox-selected rows has changed,
+ // so propagate that information
+ selectionChangeNotify();
+
+ this.table.deselectAll();
+ }
+
+ public void focusGained(FocusEvent e) {
+ }
+
+ public void focusLost(FocusEvent e) {
+ }
+
+ public void piEventReceived(PIEvent be) {
+ if (be.getType() == PIEvent.SELECTION_AREA_CHANGED2) {
+ this.tableViewer.refresh();
+ this.table.redraw();
+ }
+ }
+
+ public void updateItemData(boolean setInput) {
+ HashSet<GraphicsMemoryProcess> noDuplicateMemProcesses = myGraph
+ .getMemTrace().getNoDuplicateMemProcesses();
+ if (tableItemData == null)
+ tableItemData = new Vector<GraphicsMemoryProcess>(
+ noDuplicateMemProcesses.size());
+ else
+ tableItemData.clear();
+
+ // tableItemData contains one entry per table row
+ // the first profiled process is the system-wide total memory information
+ for (Iterator<GraphicsMemoryProcess> iter = noDuplicateMemProcesses
+ .iterator(); iter.hasNext();) {
+ GraphicsMemoryProcess memProcess = iter.next();
+ if ((memProcess.processId != GraphicsMemoryTraceParser.SAMPLE_TOTAL_MEMORY_PROCESS_ID)) {
+ tableItemData.add(memProcess);
+ }
+ }
+
+ // refresh the table, if needed
+ if (setInput)
+ refreshTableViewer();
+ }
+
+ public void refreshTableViewer() {
+ this.tableViewer.setInput(tableItemData);
+ }
+
+ public void sortOnColumnSelection(TableColumn tableColumn) {
+ int columnID = ((Integer) tableColumn.getData()).intValue();
+ ((SharedSorter) tableViewer.getSorter()).doSort(columnID);
+
+ tableViewer.refresh();
+ table.redraw();
+ }
+
+ private class ColumnSelectionHandler extends SelectionAdapter {
+ public void widgetSelected(SelectionEvent e) {
+ if (!(e.widget instanceof TableColumn))
+ return;
+
+ sortOnColumnSelection((TableColumn) e.widget);
+ }
+ }
+
+ public CheckboxTableViewer getTableViewer() {
+ return this.tableViewer;
+ }
+
+ protected void createDefaultActions() {
+ selectAllAction = new Action("SelectAll") { //$NON-NLS-1$
+ public void run() {
+ action("selectAll"); //$NON-NLS-1$
+ }
+ };
+ selectAllAction.setEnabled(true);
+
+ copyAction = new Action("Copy") { //$NON-NLS-1$
+ public void run() {
+ action("copy"); //$NON-NLS-1$
+ }
+ };
+ copyAction.setEnabled(false);
+
+ copyTableAction = new Action("CopyTable") { //$NON-NLS-1$
+ public void run() {
+ action("copyTable"); //$NON-NLS-1$
+ }
+ };
+ copyTableAction.setEnabled(true);
+ copyTableAction.setId("PICopyTable"); //$NON-NLS-1$
+ copyTableAction.setText(Messages
+ .getString("GraphicsMemoryProcessTable.copyTable")); //$NON-NLS-1$
+
+ saveTableAction = new Action("SaveTable") { //$NON-NLS-1$
+ public void run() {
+ action("saveTable"); //$NON-NLS-1$
+ }
+ };
+ saveTableAction.setEnabled(true);
+ saveTableAction.setId("PISaveTable"); //$NON-NLS-1$
+ saveTableAction.setText(Messages
+ .getString("GraphicsMemoryProcessTable.SaveTable")); //$NON-NLS-1$
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemoryReturnPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import com.nokia.carbide.cpp.internal.pi.interfaces.IReturnPlugin;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.AbstractPiPlugin;
+
+public class GraphicsMemoryReturnPlugin implements IReturnPlugin {
+ public AbstractPiPlugin getPlugin() {
+ return GraphicsMemoryPlugin.getDefault();
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemorySample.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import com.nokia.carbide.cpp.internal.pi.model.GenericSample;
+
+public class GraphicsMemorySample extends GenericSample {
+ private static final long serialVersionUID = -854731258436977706L;
+ public GraphicsMemoryProcess process;
+ public int privateSize;
+ public int sharedSize;
+ public int sampleNum; // not used
+ public int type; // not used
+
+ /**
+ * Process with time stamp
+ *
+ * @param process
+ * @param sampleSynchTime
+ */
+ public GraphicsMemorySample(GraphicsMemoryProcess process,
+ int sampleSynchTime) {
+ this.process = process;
+ this.sampleSynchTime = sampleSynchTime;
+ }
+
+ /**
+ * System memory usage with time stamp
+ *
+ * @param usedMemory
+ * @param totalMemory
+ * @param sampleNum
+ */
+ public GraphicsMemorySample(int usedMemory, int totalMemory,
+ int sampleSynchTime) {
+ this.privateSize = usedMemory;
+ this.sharedSize = totalMemory;
+ this.sampleSynchTime = sampleSynchTime;
+ this.process = new GraphicsMemoryProcess(
+ GraphicsMemoryTraceParser.SAMPLE_TOTAL_MEMORY_PROCESS_ID,
+ GraphicsMemoryTraceParser.SAMPLE_TOTAL_MEMORY_PROCESS_NAME);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemorySampleByTime.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import java.util.ArrayList;
+
+public class GraphicsMemorySampleByTime {
+ private long time;
+ private ArrayList<GraphicsMemorySample> samples;
+ private long totalMemory;
+ private long usedMemory;
+
+ public GraphicsMemorySampleByTime(long time, long totalMemory,
+ long usedMemory) {
+ this.time = time;
+ this.totalMemory = totalMemory;
+ this.usedMemory = usedMemory;
+ this.samples = new ArrayList<GraphicsMemorySample>();
+ }
+
+ public ArrayList<GraphicsMemorySample> getSamples() {
+ return this.samples;
+ }
+
+ public long getTime() {
+ return this.time;
+ }
+
+ public long getTotalMemory() {
+ return this.totalMemory;
+ }
+
+ public long getUsedMemory() {
+ return this.usedMemory;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemoryStatisticsDialog.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,240 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+/**
+ *
+ */
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import java.text.DecimalFormat;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
+import com.nokia.carbide.cpp.internal.pi.analyser.ProfileVisualiser;
+import com.nokia.carbide.cpp.pi.editors.PIPageEditor;
+
+public class GraphicsMemoryStatisticsDialog {
+
+ private Shell shell;
+ private GridData gridData;
+ private DecimalFormat formatKBytes = new DecimalFormat(Messages
+ .getString("GraphicsMemoryStatisticsDialog.KBformat")); //$NON-NLS-1$
+ private DecimalFormat formatBytes = new DecimalFormat(Messages
+ .getString("GraphicsMemoryStatisticsDialog.BytesFormat")); //$NON-NLS-1$
+ private GraphicsMemoryTrace trace;
+ private double startTime;
+ private double endTime;
+
+ public GraphicsMemoryStatisticsDialog(Display display) {
+ Group group;
+
+ shell = new Shell(display, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM | SWT.RESIZE);
+ shell.setText(Messages
+ .getString("GraphicsMemoryStatisticsDialog.statistics")); //$NON-NLS-1$
+ shell.setLayout(new GridLayout(3, false));
+
+ startTime = PIPageEditor.currentPageEditor().getStartTime();
+ endTime = PIPageEditor.currentPageEditor().getEndTime();
+
+ trace = (GraphicsMemoryTrace) NpiInstanceRepository.getInstance()
+ .activeUidGetTrace(GraphicsMemoryPlugin.PLUGIN_ID); //$NON-NLS-1$
+
+ group = new Group(shell, SWT.SHADOW_NONE);
+ group.setText(Messages
+ .getString("GraphicsMemoryStatisticsDialog.interval")); //$NON-NLS-1$
+ group.setFont(PIPageEditor.helvetica_9);
+ gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gridData.horizontalSpan = 3;
+ group.setLayoutData(gridData);
+ group.setLayout(new GridLayout(3, false));// new FillLayout());
+ textGrid(group, showTimeInterval(startTime, endTime), SWT.CENTER,
+ SWT.CENTER, 3);
+
+ int pageIndex = PIPageEditor.currentPageIndex();
+
+ GraphicsMemoryTraceGraph graph = (GraphicsMemoryTraceGraph) trace
+ .getTraceGraph(pageIndex); // since graph intervals are in
+ // lockstep, any pageIndex will do
+ GraphicsMemoryProcessTable table = graph.getGraphicsMemoryProcessTable();
+
+ MaxGraphicsMemoryItem systemUseByInterval = trace
+ .getSystemUseByInterval((long) (startTime * 1000.0),
+ (long) (endTime * 1000.0));
+
+ group = new Group(shell, SWT.NONE);
+ group.setText(Messages
+ .getString("GraphicsMemoryStatisticsDialog.onDevice")); //$NON-NLS-1$
+ group.setFont(PIPageEditor.helvetica_9);
+ gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gridData.horizontalSpan = 3;
+ group.setLayoutData(gridData);
+ group.setLayout(new GridLayout(3, false));// new FillLayout());
+
+ String usedKB = Messages
+ .getString("GraphicsMemoryStatisticsDialog.notRecorded"); //$NON-NLS-1$
+ String usedBytes = ""; //$NON-NLS-1$
+ String freeKB = usedKB;
+ String freeBytes = usedBytes;
+ String totalKB = usedKB;
+ String totalBytes = usedBytes;
+
+ if ((long) (endTime * 1000.0 + 0.5) >= trace.getFirstSampleNumber()) {
+ long deviceTotalMemory = systemUseByInterval.maxTotal;
+ long deviceUsedMemory = systemUseByInterval.maxPrivate;
+
+ usedKB = formatKBytes.format(deviceUsedMemory / 1024.0);
+ usedBytes = formatBytes.format(deviceUsedMemory);
+ freeKB = formatKBytes
+ .format((deviceTotalMemory - deviceUsedMemory) / 1024.0);
+ freeBytes = formatBytes
+ .format(deviceTotalMemory - deviceUsedMemory);
+ totalKB = formatKBytes.format(deviceTotalMemory / 1024.0);
+ totalBytes = formatBytes.format(deviceTotalMemory);
+ }
+ textGrid(
+ group,
+ Messages.getString("GraphicsMemoryStatisticsDialog.used"), SWT.LEFT, SWT.CENTER, 1); //$NON-NLS-1$
+ textGrid(group, usedKB, SWT.RIGHT, SWT.CENTER, 1);
+ textGrid(group, usedBytes, SWT.RIGHT, SWT.CENTER, 1);
+ textGrid(
+ group,
+ Messages.getString("GraphicsMemoryStatisticsDialog.free"), SWT.LEFT, SWT.CENTER, 1); //$NON-NLS-1$
+ textGrid(group, freeKB, SWT.RIGHT, SWT.CENTER, 1);
+ textGrid(group, freeBytes, SWT.RIGHT, SWT.CENTER, 1);
+ textGrid(
+ group,
+ Messages.getString("GraphicsMemoryStatisticsDialog.total"), SWT.LEFT, SWT.CENTER, 1); //$NON-NLS-1$
+ textGrid(group, totalKB, SWT.RIGHT, SWT.CENTER, 1);
+ textGrid(group, totalBytes, SWT.RIGHT, SWT.CENTER, 1);
+
+ group = new Group(shell, SWT.NONE);
+ group.setText(Messages
+ .getString("GraphicsMemoryStatisticsDialog.currentSelection")); //$NON-NLS-1$
+ group.setFont(PIPageEditor.helvetica_9);
+ gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gridData.horizontalSpan = 3;
+ group.setLayoutData(gridData);
+ group.setLayout(new GridLayout(3, false));// new FillLayout());
+
+ String privateKB = Messages
+ .getString("GraphicsMemoryStatisticsDialog.notRecorded"); //$NON-NLS-1$
+ String privateBytes = ""; //$NON-NLS-1$
+ String sharedKB = privateKB;
+ String sharedBytes = privateBytes;
+
+ if ((long) (endTime * 1000.0 + 0.5) >= trace.getFirstSampleNumber()) {
+ float selectedMaxPrivate = 0;
+ float selectedMaxShared = 0;
+
+ Object[] selected = table.getTableViewer().getCheckedElements();
+
+ for (int i = 0; i < selected.length; i++) {
+ if (selected[i] instanceof GraphicsMemoryProcess) {
+ GraphicsMemoryProcess checked = (GraphicsMemoryProcess) selected[i];
+ selectedMaxPrivate += checked.maxMemoryItem.maxPrivate;
+ selectedMaxShared += checked.maxMemoryItem.maxShared;
+ }
+ }
+
+ privateKB = formatKBytes.format(selectedMaxPrivate / 1024.0);
+ privateBytes = formatBytes.format((long) selectedMaxPrivate);
+ sharedKB = formatKBytes.format(selectedMaxShared / 1024.0);
+ sharedBytes = formatBytes.format((long) selectedMaxShared);
+ }
+
+ textGrid(
+ group,
+ Messages.getString("GraphicsMemoryStatisticsDialog.private"), SWT.LEFT, SWT.CENTER, 1); //$NON-NLS-1$
+ textGrid(group, privateKB, SWT.RIGHT, SWT.CENTER, 1);
+ textGrid(group, privateBytes, SWT.RIGHT, SWT.CENTER, 1);
+ textGrid(
+ group,
+ Messages.getString("GraphicsMemoryStatisticsDialog.shared"), SWT.LEFT, SWT.CENTER, 1); //$NON-NLS-1$
+ textGrid(group, sharedKB, SWT.RIGHT, SWT.CENTER, 1);
+ textGrid(group, sharedBytes, SWT.RIGHT, SWT.CENTER, 1);
+
+ // create the Close button
+ Button close = new Button(shell, SWT.NONE);
+ close.setText(Messages
+ .getString("GraphicsMemoryStatisticsDialog.close")); //$NON-NLS-1$
+ gridData = new GridData(SWT.CENTER, SWT.CENTER, true, true);
+ gridData.minimumWidth = 60;
+ gridData.horizontalSpan = 3;
+ close.setLayoutData(gridData);
+ close.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ shell.close();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ shell.pack();
+ shell.open();
+
+ while (!shell.isDisposed()) {
+ if (!shell.getDisplay().readAndDispatch()) {
+ shell.getDisplay().sleep();
+ }
+ }
+ }
+
+ private void textGrid(Composite parent, String text, int labelStyle,
+ int gridStyle, int gridSpan) {
+ Label label = new Label(parent, labelStyle);
+ label.setFont(PIPageEditor.helvetica_9);
+ label.setText(text);
+ gridData = new GridData(SWT.FILL, gridStyle, true, true);
+ gridData.horizontalSpan = gridSpan;
+ label.setLayoutData(gridData);
+ }
+
+ public void dispose() {
+ if (this.shell != null) {
+ if (!this.shell.isDisposed()) {
+ this.shell.close();
+ }
+ this.shell.dispose();
+ }
+
+ this.shell = null;
+ }
+
+ private static String showTimeInterval(double startTime, double endTime) {
+ return ProfileVisualiser.TIME_FORMAT.format(startTime)
+ + Messages
+ .getString("GraphicsMemoryStatisticsDialog.interval1") + ProfileVisualiser.TIME_FORMAT.format(endTime) //$NON-NLS-1$
+ + Messages
+ .getString("GraphicsMemoryStatisticsDialog.interval2") + ProfileVisualiser.TIME_FORMAT.format(endTime - startTime) //$NON-NLS-1$
+ + Messages
+ .getString("GraphicsMemoryStatisticsDialog.interval3"); //$NON-NLS-1$
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemoryTrace.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,355 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
+import com.nokia.carbide.cpp.internal.pi.model.GenericSample;
+import com.nokia.carbide.cpp.internal.pi.model.GenericSampledTrace;
+import com.nokia.carbide.cpp.internal.pi.model.GenericThread;
+import com.nokia.carbide.cpp.internal.pi.model.TraceWithThreads;
+import com.nokia.carbide.cpp.internal.pi.visual.GenericTraceGraph;
+import com.nokia.carbide.cpp.pi.editors.PIPageEditor;
+
+public class GraphicsMemoryTrace extends GenericSampledTrace implements
+ TraceWithThreads {
+ static final long serialVersionUID = 3606238546911055987L;
+
+ private transient GraphicsMemoryTraceGraph[] graphs;
+ private GraphicsMemoryProcess[] processArray;
+
+ // maximums for the entire trace
+ transient private int traceMaxPrivate = 0;
+ transient private int traceMaxShared = 0;
+ transient private int traceMaxTotal = 0;
+ transient private int traceTotalMemory = 0;
+
+ transient private Hashtable<String, TreeMap<Long, GraphicsMemorySample>> drawDataByMemProcess = null;
+ transient private ArrayList<GraphicsMemorySampleByTime> drawDataByTime;
+ transient private HashSet<GraphicsMemoryProcess> noDuplicateMemProcesses;
+
+ transient private long intervalStart = -1;
+ transient private long intervalEnd = -1;
+
+ private int version;
+
+ public GraphicsMemoryTrace() {
+ }
+
+ public GenericThread[] getThreads() {
+ return processArray;
+ }
+
+ public void setProcesses(GraphicsMemoryProcess[] processArray) {
+ this.processArray = processArray;
+ }
+
+ public int getTraceMaxPrivate() {
+ return traceMaxPrivate;
+ }
+
+ public int getTraceMaxShared() {
+ return traceMaxShared;
+ }
+
+ public int getTraceMaxTotal() {
+ return traceMaxTotal;
+ }
+
+ public int getTraceTotalMemory() {
+ return traceTotalMemory;
+ }
+
+ public void setTraceTotalMemory(int traceTotalMemory) {
+ this.traceTotalMemory = traceTotalMemory;
+ }
+
+ public void setTraceMaxShared(int traceMaxShared) {
+ this.traceMaxShared = traceMaxShared;
+ }
+
+ public void setTraceMaxTotal(int traceMaxTotal) {
+ this.traceMaxTotal = traceMaxTotal;
+ }
+
+ public void setTraceMaxPrivate(int traceMaxPrivate) {
+ this.traceMaxPrivate = traceMaxPrivate;
+ }
+
+ public int getVersion() {
+ return this.version;
+ }
+
+ public void setVersion(int version) {
+ this.version = version;
+ }
+
+ public GenericTraceGraph getTraceGraph(int graphIndex) {
+ if (graphs == null) {
+ graphs = new GraphicsMemoryTraceGraph[3];
+ }
+
+ // note that graphIndex need not match the index sent to
+ // GraphicsMemoryTraceGraph
+ if ((graphIndex == PIPageEditor.THREADS_PAGE)
+ || (graphIndex == PIPageEditor.BINARIES_PAGE)
+ || (graphIndex == PIPageEditor.FUNCTIONS_PAGE)) {
+ if (graphs[graphIndex] == null) {
+ int uid = NpiInstanceRepository.getInstance().activeUid();
+ graphs[graphIndex] = new GraphicsMemoryTraceGraph(graphIndex,
+ this, uid);
+ }
+ return graphs[graphIndex];
+ }
+ return null;
+ }
+
+ public void gatherDrawData() {
+ if (drawDataByMemProcess != null)
+ return; // already initialised
+ drawDataByMemProcess = new Hashtable<String, TreeMap<Long, GraphicsMemorySample>>();
+
+ getProcessesFromTrace();
+
+ if (drawDataByTime == null)
+ drawDataByTime = new ArrayList<GraphicsMemorySampleByTime>();
+
+ // index each sample by process name and by sample time
+ for (Enumeration<GenericSample> e = this.getSamples(); e
+ .hasMoreElements();) {
+ addSampleToProcess((GraphicsMemorySample) e.nextElement());
+ }
+ }
+
+ private void addSampleToProcess(GraphicsMemorySample sample) {
+ // get sample array from process
+ TreeMap<Long, GraphicsMemorySample> samples = drawDataByMemProcess
+ .get(sample.process.fullName);
+
+ if (samples != null) {
+ // Add initial sample to process
+ samples.put(sample.sampleSynchTime, sample);
+ return;
+ }
+
+ System.out.println("PI ERROR: Process not found"); //$NON-NLS-1$
+ }
+
+ private void getProcessesFromTrace() {
+
+ noDuplicateMemProcesses = new HashSet<GraphicsMemoryProcess>(131, 0.75f);
+
+ // the parser creates multiple copies of the same GraphicsMemoryProcess item,
+ // so we have to use the full name of the GraphicsMemoryProcess to access sample
+ // data
+
+ for (GraphicsMemoryProcess memProcess : processArray) {
+ memProcess.fullName = memProcess.processName;
+ memProcess.enabled = new boolean[3];
+ memProcess.enabled[0] = true;
+ memProcess.enabled[1] = true;
+ memProcess.enabled[2] = true;
+
+ memProcess.maxMemoryItem = new MaxGraphicsMemoryItem();
+ memProcess.maxMemoryItem.maxPrivate = 0;
+ memProcess.maxMemoryItem.maxShared = 0;
+ memProcess.maxMemoryItem.maxTotal = 0;
+
+ if (drawDataByMemProcess.get(memProcess.fullName) == null) {
+ drawDataByMemProcess.put(memProcess.fullName,
+ new TreeMap<Long, GraphicsMemorySample>());
+ noDuplicateMemProcesses.add(memProcess);
+ }
+ }
+ }
+
+ public TreeMap<Long, GraphicsMemorySample> getDrawDataByMemProcess(
+ GraphicsMemoryProcess id) {
+ return this.drawDataByMemProcess.get(id.fullName);
+ }
+
+ public Hashtable<String, TreeMap<Long, GraphicsMemorySample>> getDrawDataByMemProcess() {
+ return this.drawDataByMemProcess;
+ }
+
+ public ArrayList<GraphicsMemorySampleByTime> getDrawDataByTime() {
+
+ if (drawDataByTime.isEmpty()) {
+ TreeMap<Long, GraphicsMemorySample> events = drawDataByMemProcess
+ .get(GraphicsMemoryTraceParser.SAMPLE_TOTAL_MEMORY_PROCESS_NAME); //$NON-NLS-1$
+
+ Iterator<GraphicsMemorySample> iterator = events.values()
+ .iterator();
+ while (iterator.hasNext()) {
+ GraphicsMemorySample memSample = iterator.next();
+ drawDataByTime.add(new GraphicsMemorySampleByTime(
+ memSample.sampleSynchTime, memSample.sharedSize,
+ memSample.privateSize));
+ }
+ }
+ return this.drawDataByTime;
+ }
+
+ public HashSet<GraphicsMemoryProcess> getNoDuplicateMemProcesses() {
+ return this.noDuplicateMemProcesses;
+ }
+
+ public ArrayList<GraphicsMemorySample> getMemSampleDataByTime(long time) {
+ if ((this.drawDataByTime == null)
+ || (time < this.drawDataByTime.get(0).getTime()))
+ return null;
+
+ int i = 0;
+ for (; i < this.drawDataByTime.size(); i++) {
+ GraphicsMemorySampleByTime sample = this.drawDataByTime.get(i);
+ if (sample.getTime() > time)
+ break;
+ }
+
+ return this.drawDataByTime.get(i - 1).getSamples();
+ }
+
+ public MaxGraphicsMemoryItem getSystemUseByInterval(long startTime,
+ long endTime) {
+ MaxGraphicsMemoryItem item = new MaxGraphicsMemoryItem();
+
+ if ((this.drawDataByTime == null)
+ || ((startTime == intervalStart) && (endTime == intervalEnd)))
+ return item;
+
+ if (this.getVersion() == 100) {
+ TreeMap<Long, GraphicsMemorySample> events = drawDataByMemProcess
+ .get(GraphicsMemoryTraceParser.SAMPLE_TOTAL_MEMORY_PROCESS_NAME); //$NON-NLS-1$
+
+ GraphicsMemorySample floorSample = (GraphicsMemorySample) GraphicsMemoryTrace
+ .getFloorEntryFromMap(startTime, events);
+
+ if(floorSample != null){
+ item.maxPrivate = floorSample.privateSize;
+ item.maxTotal = floorSample.sharedSize;
+ }
+
+ SortedMap<Long, GraphicsMemorySample> sortedMap = events.subMap(startTime, endTime);
+ Iterator<GraphicsMemorySample> values = sortedMap.values().iterator();
+
+ while (values.hasNext()) {
+ GraphicsMemorySample memSample = values.next();
+ // store system used memory as privates and total memory as total
+ if (item.maxPrivate < memSample.privateSize)
+ item.maxPrivate = memSample.privateSize;
+ item.maxTotal = memSample.sharedSize;
+ if (memSample.sampleSynchTime > endTime)
+ break;
+
+ }
+
+ }
+ return item;
+ }
+
+ public void setMaxMemDataByInterval(long startTime, long endTime) {
+
+ // Set all values to zero
+ for (int i = 0; i < processArray.length; i++) {
+ MaxGraphicsMemoryItem item = processArray[i].maxMemoryItem;
+ item.maxPrivate = 0;
+ item.maxShared = 0;
+ item.maxTotal = 0;
+ }
+
+ // if no data is found between start and end time or start and end
+ // times are same with previous.
+ if ((this.drawDataByTime == null)
+ || ((startTime == intervalStart) && (endTime == intervalEnd)))
+ return;
+
+ if (this.version == 100) {
+
+ for (Enumeration<TreeMap<Long, GraphicsMemorySample>> e = drawDataByMemProcess
+ .elements(); e.hasMoreElements();) {
+ TreeMap<Long, GraphicsMemorySample> memSamples = (TreeMap<Long, GraphicsMemorySample>) e
+ .nextElement();
+
+ if (memSamples.size() == 0) {
+ continue;
+ }
+
+ GraphicsMemorySample firstSample = (GraphicsMemorySample) memSamples
+ .get(memSamples.firstKey());
+
+ GraphicsMemoryProcess process = firstSample.process;
+
+ MaxGraphicsMemoryItem maxMemoryItem = process.maxMemoryItem;
+
+ SortedMap<Long, GraphicsMemorySample> subMap = memSamples
+ .subMap(startTime, endTime);
+
+ ArrayList<GraphicsMemorySample> samples = new ArrayList<GraphicsMemorySample>(
+ subMap.values());
+
+ GraphicsMemorySample floorSample = (GraphicsMemorySample) GraphicsMemoryTrace
+ .getFloorEntryFromMap(startTime, memSamples);
+
+ if (floorSample != null) {
+
+ maxMemoryItem.maxPrivate = floorSample.privateSize;
+ maxMemoryItem.maxShared = floorSample.sharedSize;
+ maxMemoryItem.maxTotal = floorSample.privateSize
+ + floorSample.sharedSize;
+
+ }
+
+ for (GraphicsMemorySample item : samples) {
+ if (maxMemoryItem.maxPrivate < item.privateSize) {
+ maxMemoryItem.maxPrivate = item.privateSize;
+ }
+ if (maxMemoryItem.maxShared < item.sharedSize) {
+ maxMemoryItem.maxShared = item.sharedSize;
+ }
+ if (maxMemoryItem.maxTotal < item.privateSize
+ + item.sharedSize) {
+ maxMemoryItem.maxTotal = item.privateSize
+ + item.sharedSize;
+ }
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public static Object getFloorEntryFromMap(long key, TreeMap map) {
+ // TODO if JDK 6 is in use this should be used:
+ // return map.floorEntry(key).getValue();
+
+ // when JDK 5 in use use this:
+ try {
+ SortedMap headMap = map.headMap(key);
+ return headMap.get(headMap.lastKey());
+ } catch (Exception e) {
+ return null;
+ }
+
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemoryTraceGraph.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,1315 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import java.awt.Dimension;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.TreeMap;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.MouseEvent;
+import org.eclipse.draw2d.MouseMotionListener;
+import org.eclipse.draw2d.Panel;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.PlatformUI;
+
+import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
+import com.nokia.carbide.cpp.internal.pi.model.GenericSampledTrace;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.IContextMenu;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.ITitleBarMenu;
+import com.nokia.carbide.cpp.internal.pi.visual.GenericTraceGraph;
+import com.nokia.carbide.cpp.internal.pi.visual.GraphComposite;
+import com.nokia.carbide.cpp.internal.pi.visual.PIEvent;
+import com.nokia.carbide.cpp.internal.pi.visual.PIEventListener;
+import com.nokia.carbide.cpp.pi.editors.PIPageEditor;
+import com.nokia.carbide.cpp.pi.util.ColorPalette;
+import com.nokia.carbide.cpp.pi.visual.IGenericTraceGraph;
+
+public class GraphicsMemoryTraceGraph extends GenericTraceGraph implements
+ FocusListener, PIEventListener, MouseMotionListener, IContextMenu,
+ ITitleBarMenu {
+ private enum UsageType {
+ PRIVATE, SHARED, PRIVATE_SHARED
+ };
+
+ private boolean dynamicMemoryVisualisation = false;
+
+ private GraphicsMemoryProcessTable graphicsMemoryProcessTable;
+ private CheckboxTableViewer memoryTableViewer;
+
+ // 3 tabs can share the same trace, but they need different graphs
+ private GraphicsMemoryTrace memTrace;
+
+ private FigureCanvas leftFigureCanvas;
+
+ // whether any table items are enabled
+ private boolean haveEnabled = false;
+
+ private boolean readyToDraw = false;
+ private int width = 600;
+ private int height = 400;
+
+ private UsageType paintMode;
+
+ int[] sharedPoints;
+ int[] privatePoints;
+
+ private TreeMap<Long, Integer> eventPrivateListY;
+ private TreeMap<Long, Integer> eventSharedListY;
+ private TreeMap<Long, Integer> eventPrivateSharedListY;
+
+ private int maxShared = 0;
+ private int maxPrivate = 0;
+ private int maxSharedPrivate = 0;
+ private int maxUsedMemory = 0;
+
+ private DecimalFormat memKBFormat = new DecimalFormat(Messages
+ .getString("GraphicsMemoryTraceGraph.KBformat")); //$NON-NLS-1$
+ private DecimalFormat memMBFloatFormat = new DecimalFormat(Messages
+ .getString("GraphicsMemoryTraceGraph.MBformat")); //$NON-NLS-1$
+
+ private static int xLegendHeight = 50;
+
+ private boolean firstTimeDrawProcessList = true;
+
+ private Composite holder;
+
+ private boolean showMemoryUsageLine = true;
+
+ public GraphicsMemoryTraceGraph(int graphIndex,
+ GraphicsMemoryTrace memTrace, int uid) {
+ super((GenericSampledTrace) memTrace);
+
+ if (memTrace != null) {
+
+ // if no version number is found from trace, we can assume
+ // that the first version of the graphics memory model is in use
+ this.memTrace = memTrace;
+ if (memTrace.getVersion() == 0) {
+ memTrace.setVersion(100);
+ }
+ }
+
+ this.graphIndex = graphIndex;
+ this.memTrace = memTrace;
+ this.paintMode = UsageType.PRIVATE_SHARED;
+ this.setScale(10);
+
+ if (memTrace == null) {
+ System.out.print(Messages
+ .getString("GraphicsMemoryTraceGraph.traceDataNotFound")); //$NON-NLS-1$
+ return;
+ }
+
+ memTrace.gatherDrawData();
+
+ // create the label and a tableviewer
+ holder = new Composite(NpiInstanceRepository.getInstance()
+ .getProfilePage(uid, graphIndex).getBottomComposite(), SWT.NONE);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(holder,
+ GraphicsMemoryPlugin.HELP_CONTEXT_ID_MAIN_PAGE);
+
+ holder.setLayout(new FillLayout());
+ this.graphicsMemoryProcessTable = new GraphicsMemoryProcessTable(this,
+ holder);
+
+ this.memoryTableViewer = this.graphicsMemoryProcessTable
+ .getTableViewer();
+
+ this.readyToDraw = true;
+ }
+
+ public void action(String actionString) {
+ if (actionString.equals("private_on")) //$NON-NLS-1$
+ {
+ paintMode = UsageType.PRIVATE;
+ } else if (actionString.equals("shared_on")) //$NON-NLS-1$
+ {
+ paintMode = UsageType.SHARED;
+ } else if (actionString.equals("private_shared_on")) //$NON-NLS-1$
+ {
+ paintMode = UsageType.PRIVATE_SHARED;
+ } else if (actionString.equals("rescale_on")) //$NON-NLS-1$
+ {
+ dynamicMemoryVisualisation = true;
+ makeProcessDrawLists();
+ } else if (actionString.equals("rescale_off")) //$NON-NLS-1$
+ {
+ dynamicMemoryVisualisation = false;
+ makeProcessDrawLists();
+ } else if (actionString.equals("memory_usage_line_on")) //$NON-NLS-1$
+ {
+ showMemoryUsageLine = true;
+ } else if (actionString.equals("memory_usage_line_off")) //$NON-NLS-1$
+ {
+ showMemoryUsageLine = false;
+ } else {
+ return;
+ }
+
+ this.repaint();
+ if (this.leftFigureCanvas != null)
+ this.leftFigureCanvas.redraw();
+ }
+
+ public void piEventReceived(PIEvent be) {
+ switch (be.getType()) {
+ // when the selection area changes, the maximum values shown for each
+ // process
+ // may change; if dynamicMemoryVisualisation is on, we'll also have a
+ // new y-scaling factor
+ case PIEvent.SELECTION_AREA_CHANGED:
+
+ // before updating the tables, make sure that the memory trace has
+ // computing the
+ // maximum usage by each process within the new time interval
+ double startTime = PIPageEditor.currentPageEditor().getStartTime();
+ double endTime = PIPageEditor.currentPageEditor().getEndTime();
+
+ memTrace.setMaxMemDataByInterval((int) (startTime * 1000),
+ (int) (endTime * 1000));
+
+ // send this message to the 2 other graphs
+ PIEvent be2 = new PIEvent(be.getValueObject(),
+ PIEvent.SELECTION_AREA_CHANGED2);
+
+ for (int i = 0; i < 3; i++) {
+ GraphicsMemoryTraceGraph graph = (GraphicsMemoryTraceGraph) memTrace
+ .getTraceGraph(i);
+
+ if (graph != this) {
+ graph.piEventReceived(be2);
+ }
+ }
+
+ be = be2;
+
+ // FALL THROUGH
+ case PIEvent.SELECTION_AREA_CHANGED2:
+ double[] values = (double[]) be.getValueObject();
+ this.setSelectionStart(values[0]);
+ this.setSelectionEnd(values[1]);
+ this.graphicsMemoryProcessTable.piEventReceived(be);
+ this.repaint();
+ break;
+
+ case PIEvent.CHANGED_MEMORY_TABLE:
+ this.makeProcessDrawLists();
+ this.repaint();
+ if (this.leftFigureCanvas != null)
+ this.leftFigureCanvas.redraw();
+ break;
+
+ case PIEvent.SCALE_CHANGED:
+ double scale = ((Double) be.getValueObject()).doubleValue();
+ this.setScale(scale);
+ this.repaint();
+ break;
+
+ case PIEvent.SCROLLED:
+ Event event = ((Event) be.getValueObject());
+ this.parentComponent.setScrolledOrigin(event.x, event.y,
+ (FigureCanvas) event.data);
+ this.repaint();
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ public void focusGained(FocusEvent fe) {
+ }
+
+ public void focusLost(FocusEvent fe) {
+ }
+
+ public void paint(Panel panel, Graphics graphics) {
+ if (!readyToDraw)
+ return;
+
+ this.setSize(this.getSize().width, getVisualSize().height);
+ this.makeProcessDrawLists();
+ this.paintProcesses(graphics);
+ this.drawDottedLineBackground(graphics,
+ GraphicsMemoryTraceGraph.xLegendHeight);
+
+ if (showMemoryUsageLine) {
+ paintMemoryUsageLine(graphics);
+ }
+ // draw the same selection as the Address/Process trace
+ this.drawSelectionSection(graphics,
+ GraphicsMemoryTraceGraph.xLegendHeight);
+
+ }
+
+ private void paintMemoryUsageLine(Graphics graphics) {
+ Color black = ColorPalette.getColor(new RGB(0, 0, 0));
+ graphics.setBackgroundColor(black);
+ graphics.setForegroundColor(black);
+ PointList pl = new PointList();
+ Iterator<GraphicsMemorySampleByTime> iterator = memTrace
+ .getDrawDataByTime().iterator();
+ while (iterator.hasNext()) {
+ GraphicsMemorySampleByTime msbt = iterator.next();
+ // calculate new x coord's value and round it to integer
+ int xCoord = (int) ((msbt.getTime() / getScale()) + 0.5);
+ int maxBytes;
+ if (dynamicMemoryVisualisation) {
+
+ if (paintMode == UsageType.PRIVATE) {
+ maxBytes = maxPrivate;
+ } else if (paintMode == UsageType.SHARED) {
+ maxBytes = maxShared;
+ } else {
+ maxBytes = maxSharedPrivate;
+ }
+ } else {
+ if (paintMode == UsageType.PRIVATE) {
+ if (showMemoryUsageLine) {
+ maxBytes = memTrace.getTraceTotalMemory();
+ } else {
+ maxBytes = memTrace.getTraceMaxPrivate();
+ }
+ } else if (paintMode == UsageType.SHARED) {
+ maxBytes = memTrace.getTraceMaxShared();
+ } else {
+ if (showMemoryUsageLine) {
+ maxBytes = memTrace.getTraceTotalMemory();
+ } else {
+ maxBytes = memTrace.getTraceMaxTotal();
+ }
+ }
+ }
+
+ int yMultiplier = prettyMaxBytes(maxBytes) / height;
+ // calculate new y-coord's value and round it to integer
+ int yCoord = (int) (((double) height - (double) msbt
+ .getUsedMemory()
+ / yMultiplier) + 0.5);
+ if(pl.size() > 0) {
+ pl.addPoint(xCoord, pl.getLastPoint().y);
+ }
+ pl.addPoint(xCoord, yCoord);
+ }
+ graphics.setLineWidth(2);
+ graphics.drawPolyline(pl);
+ }
+
+ private void paintPrivates(Graphics graphics) {
+ graphics.setBackgroundColor(ColorConstants.lightBlue);
+ graphics.fillPolygon(privatePoints);
+ graphics.setBackgroundColor(ColorConstants.gray);
+ }
+
+ private void paintShared(Graphics graphics, UsageType paintMode) {
+ if (eventSharedListY == null)
+ return;
+
+ // if needed, move every y-value that is 0 down a little so that the
+ // line is more visible
+ // boolean increase0 = paintMode != UsageType.SHARED;
+
+ if (paintMode == UsageType.SHARED) {
+ graphics.setBackgroundColor(ColorConstants.lightGreen);
+ graphics.fillPolygon(sharedPoints);
+ graphics.setBackgroundColor(ColorConstants.gray);
+ } else {
+ int lineWidth = graphics.getLineWidth();
+ Color color = graphics.getForegroundColor();
+
+ graphics.setForegroundColor(ColorConstants.lightGreen);
+ graphics.setLineWidth(2);
+ graphics.drawPolyline(sharedPoints);
+ graphics.setForegroundColor(color);
+ graphics.setLineWidth(lineWidth);
+ }
+ }
+
+ private void paintProcesses(Graphics graphics) {
+ // paints treads when using event based memory model
+
+ // if there are no processes to draw
+ if (!haveEnabled)
+ return;
+
+ int maxBytes = 0;
+
+ double yMultiplier;
+ double xMultiplier;
+ xMultiplier = this.getScale();
+
+ // get las x coordinate of trace
+ long lastEvent = ((GraphicsMemorySample) memTrace.samples
+ .get(memTrace.samples.size() - 1)).sampleSynchTime;
+ int lastXCoord = (int) (lastEvent / xMultiplier);
+
+ if (paintMode == UsageType.PRIVATE && eventPrivateListY != null) {
+ privatePoints = new int[eventPrivateListY.size() * 4 + 6];
+
+ if (dynamicMemoryVisualisation)
+ maxBytes = maxPrivate;
+ else {
+ if (showMemoryUsageLine) {
+ maxBytes = memTrace.getTraceTotalMemory();
+ } else {
+ maxBytes = memTrace.getTraceMaxPrivate();
+ }
+
+ }
+
+ // multiplier is bytes / pixel in the graph
+ yMultiplier = prettyMaxBytes(maxBytes) / height;
+
+ createGraphPolygon(this.eventPrivateListY, privatePoints,
+ xMultiplier, yMultiplier, lastXCoord);
+
+ this.paintPrivates(graphics);
+ } else if (paintMode == UsageType.SHARED && eventSharedListY != null) {
+ sharedPoints = new int[eventSharedListY.size() * 4 + 6];
+
+ if (dynamicMemoryVisualisation)
+ maxBytes = maxShared;
+ else {
+ maxBytes = memTrace.getTraceMaxShared();
+ }
+
+ // multiplier is bytes / pixel in the final graph
+ yMultiplier = prettyMaxBytes(maxBytes) / height;
+
+ createGraphPolygon(this.eventSharedListY, sharedPoints,
+ xMultiplier, yMultiplier, lastXCoord);
+ this.paintShared(graphics, paintMode);
+ } else if (eventPrivateSharedListY != null) // private and shared
+ {
+ sharedPoints = new int[eventSharedListY.size() * 4 + 6];
+ privatePoints = new int[eventPrivateListY.size() * 4 + 6];
+
+ if (dynamicMemoryVisualisation)
+ maxBytes = maxPrivate > maxShared ? maxPrivate : maxShared;
+ else {
+ if (showMemoryUsageLine) {
+ maxBytes = memTrace.getTraceTotalMemory();
+ } else {
+ maxBytes = memTrace.getTraceMaxPrivate() > memTrace
+ .getTraceMaxShared() ? memTrace
+ .getTraceMaxPrivate() : memTrace
+ .getTraceMaxShared();
+ }
+ }
+
+ // multiplier is bytes / pixel in the final graph
+ yMultiplier = prettyMaxBytes(maxBytes) / height;
+
+ int totalSharedUsed = 1;
+
+ createGraphPolygon(this.eventSharedListY, sharedPoints,
+ xMultiplier, yMultiplier, lastXCoord);
+ createGraphPolygon(this.eventPrivateListY, privatePoints,
+ xMultiplier, yMultiplier, lastXCoord);
+
+ this.paintPrivates(graphics);
+ if (totalSharedUsed > 0)
+ this.paintShared(graphics, paintMode);
+ }
+
+ }
+
+ public void createGraphPolygon(TreeMap<Long, Integer> map, int[] points,
+ double xMultiplier, double yMultiplier, int endXCoord) {
+ // Creates graph polygon from TreeMap that contains all x and y values
+ // of one graph.
+
+ int index = 2;
+ int xCoord = 0;
+ int yCoord = 0;
+ int previousYCoord = 0;
+
+ // get first event and key from map.
+ Iterator<Long> keys = map.keySet().iterator();
+ Iterator<Integer> values = map.values().iterator();
+
+ int previousXCoord = 0;
+ int countOfSameXCoords = 1;
+
+ // set first into zero so that polygon is drawn correctly
+ points[0] = 0;
+ points[1] = height;
+
+ while (keys.hasNext()) {
+ // create polygon's points so that each memory allocation is drawn
+ // as one leap in graph
+
+ // calculate new x coord's value and round it to integer
+ xCoord = (int) (((double) keys.next() / xMultiplier) + 0.5);
+
+ // calculate new y-coord's value and round it to integer
+ yCoord = (int) (((double) height - (double) values.next()
+ / yMultiplier) + 0.5);
+
+ if (xCoord == previousXCoord && index > 3) {
+ // if more than one sample at one point in the screen, count
+ // average value
+ // for y coordinate
+
+ // count average value
+ double sum = ((double) yCoord + (double) previousYCoord
+ * (double) countOfSameXCoords);
+ countOfSameXCoords++;
+ yCoord = (int) (sum / (double) (countOfSameXCoords));
+
+ // add average coordinate to array
+ index = index - 4;
+ index = addCoordsToGraphArray(xCoord, yCoord, index, points);
+
+ } else {
+ countOfSameXCoords = 1;
+ }
+
+ index = addCoordsToGraphArray(xCoord, yCoord, index, points);
+
+ // save coordinates to previousValues
+ previousYCoord = yCoord;
+ previousXCoord = xCoord;
+ }
+
+ // Set last coordinates to zero so that polygon is drawn correctly
+ points[points.length - 4] = endXCoord;
+ points[points.length - 3] = points[points.length - 5];
+
+ points[points.length - 2] = endXCoord;
+ points[points.length - 1] = height;
+ }
+
+ private int addCoordsToGraphArray(int xCoord, int yCoord, int arrayIndex,
+ int[] array) {
+
+ // adds coordinates to array so that polygon can be drawn from that
+ // array
+
+ // instead of straight lines between points, we draw graph more
+ // realistically
+ // so that single memory events are shown as a leap in graph.
+
+ // first x coordinate
+ array[arrayIndex] = xCoord;
+ arrayIndex++;
+
+ // first y coordinate, if possible use same y-coord than previous value
+ if ((arrayIndex - 2) < 0) {
+ array[arrayIndex] = 0;
+ } else {
+ array[arrayIndex] = array[arrayIndex - 2];
+ }
+ arrayIndex++;
+
+ // second x coordinate
+ array[arrayIndex] = xCoord;
+ arrayIndex++;
+
+ // second y coordinate
+ array[arrayIndex] = yCoord;
+ arrayIndex++;
+
+ return arrayIndex;
+ }
+
+ private void makeProcessDrawLists() {
+ // Get checked table items
+ Object[] checked = this.memoryTableViewer.getCheckedElements();
+
+ // if no items is checked do nothing
+ haveEnabled = (checked != null) && (checked.length > 0);
+ if (!haveEnabled) {
+ this.eventPrivateListY = null;
+ this.eventSharedListY = null;
+ this.eventPrivateSharedListY = null;
+ return;
+ }
+
+ // create maps for events for private, shared and privateshared
+ this.eventPrivateListY = new TreeMap<Long, Integer>();
+ this.eventSharedListY = new TreeMap<Long, Integer>();
+ this.eventPrivateSharedListY = new TreeMap<Long, Integer>();
+
+ // go through checked items
+ for (int j = 0; j < checked.length; j++) {
+ // check that item is instance of memory process
+ if (!(checked[j] instanceof GraphicsMemoryProcess))
+ continue;
+
+ GraphicsMemoryProcess memProcess = (GraphicsMemoryProcess) checked[j];
+
+ // get all samples of the process
+ TreeMap<Long, GraphicsMemorySample> memSamples = memTrace
+ .getDrawDataByMemProcess(memProcess);
+
+ // ensure that process has samples
+ if ((memSamples == null) || (memSamples.size() == 0)) {
+ System.out
+ .println(Messages
+ .getString("GraphicsMemoryTraceGraph.processNoSamples1") + memProcess.fullName + Messages.getString("GraphicsMemoryTraceGraph.processNoSamples")); //$NON-NLS-1$ //$NON-NLS-2$
+ continue;
+ }
+
+ // create empty sample
+ GraphicsMemorySample previousSample = new GraphicsMemorySample(
+ new GraphicsMemoryProcess(0, ""), //$NON-NLS-1$ //$NON-NLS-2$
+ 0);
+
+ Iterator<GraphicsMemorySample> values = memSamples.values()
+ .iterator();
+
+ while (values.hasNext()) {
+ GraphicsMemorySample memSample = values.next();
+ // go thru samples from single threas
+ // save changes after last received sample into TreeMaps
+ addEventToTreeMap(this.eventSharedListY,
+ memSample.sampleSynchTime, memSample.sharedSize
+ - previousSample.sharedSize);
+ addEventToTreeMap(this.eventPrivateListY,
+ memSample.sampleSynchTime, memSample.privateSize
+ - previousSample.privateSize);
+ addEventToTreeMap(
+ this.eventPrivateSharedListY,
+ memSample.sampleSynchTime,
+ memSample.privateSize
+ + memSample.sharedSize
+ - (previousSample.sharedSize + previousSample.privateSize));
+ previousSample = memSample;
+
+ }
+ }
+ Hashtable<String, TreeMap<Long, GraphicsMemorySample>> memProcesses = memTrace
+ .getDrawDataByMemProcess();
+ Iterator<GraphicsMemorySample> iterator = memProcesses.get(
+ GraphicsMemoryTraceParser.SAMPLE_TOTAL_MEMORY_PROCESS_NAME)
+ .values().iterator();
+ while (iterator.hasNext()) {
+ this.maxUsedMemory = iterator.next().sharedSize;
+ break;
+ }
+
+ // calculate max values and values in each event
+ this.maxShared = calculateValuesInEachEvent(eventSharedListY);
+ this.maxSharedPrivate = calculateValuesInEachEvent(eventPrivateSharedListY);
+ this.maxPrivate = calculateValuesInEachEvent(eventPrivateListY);
+
+ if (this.memTrace.getTraceMaxPrivate() == 0) {
+ this.memTrace.setTraceMaxPrivate(maxPrivate);
+ this.memTrace.setTraceMaxShared(maxShared);
+ this.memTrace.setTraceMaxTotal(maxSharedPrivate);
+ this.memTrace.setTraceTotalMemory(maxUsedMemory);
+ // repaint left legend if this is first time that tread lists are
+ // made
+ if (firstTimeDrawProcessList) {
+ this.parentComponent.paintLeftLegend();
+ firstTimeDrawProcessList = false;
+ }
+
+ }
+ }
+
+ private int calculateValuesInEachEvent(TreeMap<Long, Integer> map) {
+ // this function calculates total sum memory in each event based
+ // on the change map it receives as a parameter
+
+ // function also returns maximum value in whole map
+
+ int maxValue = 0;
+ int previousValue = 0;
+
+ Iterator<Integer> values = map.values().iterator();
+ Iterator<Long> keys = map.keySet().iterator();
+
+ while (values.hasNext()) {
+
+ int memValue = values.next();
+ long memKey = keys.next();
+
+ // go thru array and count actual state of
+ // memory in each event
+ int value = previousValue + memValue;
+
+ // is value is greater that max value save
+ // it as max value
+ if (value > maxValue) {
+ maxValue = value;
+ }
+
+ map.put(memKey, value);
+ previousValue = value;
+ }
+ return maxValue;
+ }
+
+ private void addEventToTreeMap(TreeMap<Long, Integer> map, long key,
+ int item) {
+ // Adds event into tree map.
+ // If event with that same key(time code) already exists values are
+ // added.
+
+ int previousValue = 0;
+ if (map.containsKey(key)) {
+ previousValue = map.get(key);
+ }
+
+ map.put(key, previousValue + item);
+ }
+
+ public void setSize(int x, int y) {
+ this.width = x;
+ this.height = y - GraphicsMemoryTraceGraph.xLegendHeight;
+
+ if (this.height <= 0)
+ this.height = 1;
+ }
+
+ public Dimension getSize() {
+ return new Dimension(width, height);
+ }
+
+ public void repaint() {
+ this.parentComponent.repaintComponent();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seecom.nokia.carbide.cpp.internal.pi.plugin.model.IContextMenu#
+ * addContextMenuItems(org.eclipse.swt.widgets.Menu,
+ * org.eclipse.swt.events.MouseEvent)
+ */
+ public void addContextMenuItems(Menu menu,
+ org.eclipse.swt.events.MouseEvent me) {
+
+ new MenuItem(menu, SWT.SEPARATOR);
+
+ MenuItem memoryStatsItem = new MenuItem(menu, SWT.PUSH);
+ memoryStatsItem.setText(Messages
+ .getString("GraphicsMemoryPlugin.memoryStats")); //$NON-NLS-1$
+ memoryStatsItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ new GraphicsMemoryStatisticsDialog(Display.getCurrent());
+ }
+ });
+
+ Object obj;
+
+ boolean rescale = false;
+
+ // if there is a rescale value associated with the current Analyser tab,
+ // then use it
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".rescale"); //$NON-NLS-1$
+ if ((obj != null) && (obj instanceof Boolean))
+ // retrieve the current value
+ rescale = (Boolean) obj;
+ else
+ // set the initial value
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".rescale", rescale); //$NON-NLS-1$
+
+ final boolean rescaleFinal = rescale;
+
+ MenuItem rescaleItem = new MenuItem(menu, SWT.CHECK);
+ rescaleItem.setText(Messages
+ .getString("GraphicsMemoryPlugin.dynamicRescale")); //$NON-NLS-1$
+ rescaleItem.setSelection(rescale);
+ rescaleItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ String action;
+ NpiInstanceRepository
+ .getInstance()
+ .activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".rescale", !rescaleFinal); //$NON-NLS-1$
+ if (!rescaleFinal) {
+ action = "rescale_on"; //$NON-NLS-1$
+ } else {
+ action = "rescale_off"; //$NON-NLS-1$
+ }
+
+ for (int i = 0; i < 3; i++) {
+ GraphicsMemoryTraceGraph graph = (GraphicsMemoryTraceGraph) memTrace
+ .getTraceGraph(i);
+ graph.action(action);
+ }
+ GraphicsMemoryPlugin.getDefault().updateMenuItems();
+ }
+ });
+
+ // if there is a show memory usage value associated with the current
+ // Analyser tab, then use it
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showMemoryUsage"); //$NON-NLS-1$
+ if ((obj != null) && (obj instanceof Boolean))
+ // retrieve the current value
+ showMemoryUsageLine = (Boolean) obj;
+ else
+ // set the initial value
+ NpiInstanceRepository
+ .getInstance()
+ .activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showMemoryUsage", showMemoryUsageLine); //$NON-NLS-1$
+
+ new MenuItem(menu, SWT.SEPARATOR);
+ MenuItem memoryUsageLine = new MenuItem(menu, SWT.CHECK);
+ memoryUsageLine.setText(Messages
+ .getString("GraphicsMemoryTraceGraph.showTotalMemoryUsage")); //$NON-NLS-1$
+ memoryUsageLine.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ showMemoryUsageLine = !showMemoryUsageLine;
+ NpiInstanceRepository
+ .getInstance()
+ .activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID
+ + ".showMemoryUsage", showMemoryUsageLine); //$NON-NLS-1$
+ repaint();
+ GraphicsMemoryPlugin.getDefault().updateMenuItems();
+ }
+ });
+ memoryUsageLine.setSelection(showMemoryUsageLine);
+
+ }
+
+ public void paintLeftLegend(FigureCanvas figureCanvas, GC gc) {
+ // if there are no processes to draw
+ GC localGC = gc;
+
+ if (gc == null)
+ gc = new GC(PIPageEditor.currentPageEditor().getSite().getShell());
+
+ if (this.leftFigureCanvas == null)
+ this.leftFigureCanvas = figureCanvas;
+
+ Rectangle rect = ((GraphComposite) figureCanvas.getParent()).figureCanvas
+ .getClientArea();
+
+ Combo titleCombo = ((GraphComposite) figureCanvas.getParent())
+ .getTitleBarCombo();
+
+ double visY = rect.height - GraphicsMemoryTraceGraph.xLegendHeight;
+
+ gc.setForeground(ColorPalette.getColor(new RGB(100, 100, 100)));
+ gc.setBackground(ColorPalette.getColor(new RGB(255, 255, 255)));
+
+ int maxBytes = 0;
+
+ if (paintMode == UsageType.PRIVATE) {
+ if (dynamicMemoryVisualisation)
+ maxBytes = maxPrivate;
+ else {
+ if (showMemoryUsageLine) {
+ maxBytes = memTrace.getTraceTotalMemory();
+ } else {
+ maxBytes = memTrace.getTraceMaxPrivate();
+ }
+ }
+
+ titleCombo.select(0);
+ } else if (paintMode == UsageType.SHARED) {
+ if (dynamicMemoryVisualisation)
+ maxBytes = maxShared;
+ else
+ maxBytes = memTrace.getTraceMaxShared();
+ titleCombo.select(1);
+ } else {
+ if (dynamicMemoryVisualisation)
+ maxBytes = maxPrivate > maxShared ? maxPrivate : maxShared;
+ else {
+ if (showMemoryUsageLine) {
+ maxBytes = memTrace.getTraceTotalMemory();
+ } else {
+ maxBytes = memTrace.getTraceMaxPrivate() > memTrace
+ .getTraceMaxShared() ? memTrace
+ .getTraceMaxPrivate() : memTrace
+ .getTraceMaxShared();
+ }
+ }
+ titleCombo.select(2);
+ }
+
+ double multiplier = 0;
+
+ multiplier = prettyMaxBytes(maxBytes) / visY;
+
+ int previousBottom = 0; // bottom of the previous legend drawn
+ String legend;
+ double yIncrement = visY / 10;
+
+ // draw 11 value indicators (0..10) to the scale
+ for (int k = 10; k >= 0; k--) {
+ // location for the value indicator is k * 1/10 the height of the
+ // display
+ int y = (int) (visY - (yIncrement * k));
+
+ // calculate the exact byte value at the height by multiplying
+ // the height with the [bytes / pixel] value
+ int bytes = (int) ((visY * multiplier) / 10.0) * k;
+
+ // construct the text for each scale
+ legend = ""; //$NON-NLS-1$
+
+ // if the amount of data is less than 512KB, draw it as bytes
+ if (maxBytes < 10000) {
+ legend += bytes
+ + Messages.getString("GraphicsMemoryTraceGraph.byByte"); //$NON-NLS-1$
+ }
+ // if the amount is more than 512KB, draw it as KB
+ else if (maxBytes <= 500 * 1024) {
+ legend += (bytes / 1024)
+ + Messages.getString("GraphicsMemoryTraceGraph.byKB"); //$NON-NLS-1$
+ } else {
+ legend += memMBFloatFormat
+ .format(((float) bytes / (1024 * 1024)))
+ + Messages.getString("GraphicsMemoryTraceGraph.byMB"); //$NON-NLS-1$
+ }
+
+ Point extent = gc.stringExtent(legend);
+
+ gc.drawLine(IGenericTraceGraph.Y_LEGEND_WIDTH - 3, (int) y + 1,
+ IGenericTraceGraph.Y_LEGEND_WIDTH, (int) y + 1);
+
+ if (y >= previousBottom) {
+ gc.drawString(legend, IGenericTraceGraph.Y_LEGEND_WIDTH
+ - extent.x - 4, (int) y);
+ previousBottom = (int) y + extent.y;
+ }
+ }
+
+ if (localGC == null) {
+ gc.dispose();
+ figureCanvas.redraw();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.draw2d.MouseMotionListener#mouseDragged(org.eclipse.draw2d
+ * .MouseEvent)
+ */
+ public void mouseDragged(MouseEvent me) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.draw2d.MouseMotionListener#mouseEntered(org.eclipse.draw2d
+ * .MouseEvent)
+ */
+ public void mouseEntered(MouseEvent me) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.draw2d.MouseMotionListener#mouseExited(org.eclipse.draw2d
+ * .MouseEvent)
+ */
+ public void mouseExited(MouseEvent me) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.draw2d.MouseMotionListener#mouseHover(org.eclipse.draw2d.
+ * MouseEvent)
+ */
+ public void mouseHover(MouseEvent me) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.draw2d.MouseMotionListener#mouseMoved(org.eclipse.draw2d.
+ * MouseEvent)
+ */
+ public void mouseMoved(MouseEvent me) {
+ double x = me.x * this.getScale();
+ double y = me.y;
+
+ // mouse event may return out of range X, that may
+ // crash when we use it to index data array
+ x = x >= 0 ? x : 0;
+ if (me.x >= this.getVisualSize().width
+ + this.parentComponent.getScrolledOrigin(this).x) {
+ x = (this.getVisualSize().width - 1) * this.getScale();
+ }
+
+ if (x > PIPageEditor.currentPageEditor().getMaxEndTime() * 1000) {
+ this.setToolTipText(null);
+ return;
+ }
+
+ if (y > this.getVisualSizeY() - GraphicsMemoryTraceGraph.xLegendHeight) {
+ this.setToolTipText(null);
+ return;
+ }
+
+ long privateSize = 0;
+ long sharedSize = 0;
+ if (memTrace.getVersion() == 100) {
+ if (eventSharedListY != null) {
+ Integer value = (Integer) GraphicsMemoryTrace
+ .getFloorEntryFromMap((long) x, eventSharedListY);
+ if (value != null) {
+ sharedSize = value;
+ }
+ }
+ if (eventPrivateListY != null) {
+ Integer value = (Integer) GraphicsMemoryTrace
+ .getFloorEntryFromMap((long) x, eventPrivateListY);
+ if (value != null) {
+ privateSize = value;
+ }
+
+ }
+ }
+ int time = (int) x;
+
+ if (this.paintMode == UsageType.PRIVATE_SHARED) {
+ this
+ .setToolTipText((time / 1000.0)
+ + Messages
+ .getString("GraphicsMemoryTraceGraph.totalTooltip1") //$NON-NLS-1$
+ + memKBFormat.format((privateSize + 512) / 1024)
+ + Messages
+ .getString("GraphicsMemoryTraceGraph.totalTooltip2") //$NON-NLS-1$
+ + memKBFormat.format((sharedSize + 512) / 1024));
+ } else if (this.paintMode == UsageType.PRIVATE) {
+ this
+ .setToolTipText((time / 1000.0)
+ + Messages
+ .getString("GraphicsMemoryTraceGraph.privateTooltip1") //$NON-NLS-1$
+ + (privateSize + 512)
+ / 1024
+ + Messages
+ .getString("GraphicsMemoryTraceGraph.privateTooltip2")); //$NON-NLS-1$
+ } else if (this.paintMode == UsageType.SHARED) {
+ this
+ .setToolTipText((time / 1000.0)
+ + Messages
+ .getString("GraphicsMemoryTraceGraph.sharedTooltip1") //$NON-NLS-1$
+ + (sharedSize + 512)
+ / 1024
+ + Messages
+ .getString("GraphicsMemoryTraceGraph.sharedTooltip2")); //$NON-NLS-1$
+ } else
+ return;
+
+ }
+
+ public int getGraphIndex() {
+ return this.graphIndex;
+ }
+
+ public GraphicsMemoryTrace getMemTrace() {
+ return this.memTrace;
+ }
+
+ public GraphicsMemoryProcessTable getGraphicsMemoryProcessTable() {
+ return this.graphicsMemoryProcessTable;
+ }
+
+ public boolean haveEnabled() {
+ return this.haveEnabled;
+ }
+
+ private int prettyMaxBytes(int bytes) {
+ if (bytes < 1000)
+ bytes = 1000;
+ else if (bytes < 10000)
+ bytes = 10000;
+ else if (bytes <= 10 * 1024)
+ bytes = 10 * 1024;
+ else if (bytes <= 20 * 1024)
+ bytes = 20 * 1024;
+ else if (bytes <= 30 * 1024)
+ bytes = 30 * 1024;
+ else if (bytes <= 50 * 1024)
+ bytes = 50 * 1024;
+ else if (bytes <= 100 * 1024)
+ bytes = 100 * 1024;
+ else if (bytes <= 200 * 1024)
+ bytes = 200 * 1024;
+ else if (bytes <= 300 * 1024)
+ bytes = 300 * 1024;
+ else if (bytes <= 500 * 1024)
+ bytes = 500 * 1024;
+ else if (bytes <= 1000 * 1024)
+ bytes = 1000 * 1024;
+ else if (bytes <= 1 * 1024 * 1024)
+ bytes = 1 * 1024 * 1024;
+ else if (bytes <= 2 * 1024 * 1024)
+ bytes = 2 * 1024 * 1024;
+ else if (bytes <= 3 * 1024 * 1024)
+ bytes = 3 * 1024 * 1024;
+ else if (bytes <= 5 * 1024 * 1024)
+ bytes = 5 * 1024 * 1024;
+ else if (bytes <= 10 * 1024 * 1024)
+ bytes = 10 * 1024 * 1024;
+ else if (bytes <= 20 * 1024 * 1024)
+ bytes = 20 * 1024 * 1024;
+ else if (bytes <= 30 * 1024 * 1024)
+ bytes = 30 * 1024 * 1024;
+ else if (bytes <= 40 * 1024 * 1024)
+ bytes = 40 * 1024 * 1024;
+ else if (bytes <= 50 * 1024 * 1024)
+ bytes = 50 * 1024 * 1024;
+ else if (bytes <= 60 * 1024 * 1024)
+ bytes = 60 * 1024 * 1024;
+ else if (bytes <= 80 * 1024 * 1024)
+ bytes = 80 * 1024 * 1024;
+ else if (bytes <= 100 * 1024 * 1024)
+ bytes = 100 * 1024 * 1024;
+ else
+ bytes = ((bytes + 1024 * 1024 * 1024 - 1) / (1024 * 1024 * 1024))
+ * (1024 * 1024 * 1024);
+
+ return bytes;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seecom.nokia.carbide.cpp.internal.pi.plugin.model.ITitleBarMenu#
+ * addTitleBarMenuItems()
+ */
+ public Action[] addTitleBarMenuItems() {
+
+ // Create actions for Title Bar's drop-down list
+
+ ArrayList<Action> actionArrayList = new ArrayList<Action>();
+
+ // Action for showing only privates
+ Action actionShowPrivate = new Action() {
+ public void run() {
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showPrivate", true); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showShared", false); //$NON-NLS-1$
+
+ for (int i = 0; i < 3; i++) {
+ GraphicsMemoryTraceGraph graph = (GraphicsMemoryTraceGraph) memTrace
+ .getTraceGraph(i);
+ graph.action("private_on"); //$NON-NLS-1$
+ }
+ GraphicsMemoryPlugin.getDefault().updateMenuItems();
+ }
+ };
+ actionShowPrivate.setText(Messages
+ .getString("GraphicsMemoryPlugin.showPrivate")); //$NON-NLS-1$
+
+ // Action for showing only shareds
+ Action actionShowShared = new Action() {
+ public void run() {
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showPrivate", false); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showShared", true); //$NON-NLS-1$
+
+ for (int i = 0; i < 3; i++) {
+ GraphicsMemoryTraceGraph graph = (GraphicsMemoryTraceGraph) memTrace
+ .getTraceGraph(i);
+ graph.action("shared_on"); //$NON-NLS-1$
+ }
+ GraphicsMemoryPlugin.getDefault().updateMenuItems();
+ }
+ };
+ actionShowShared.setText(Messages
+ .getString("GraphicsMemoryPlugin.showShared")); //$NON-NLS-1$
+
+ // Action for showing both shareds and privates
+ Action actionShowBothItem = new Action() {
+ public void run() {
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showPrivate", true); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showShared", true); //$NON-NLS-1$
+
+ for (int i = 0; i < 3; i++) {
+ GraphicsMemoryTraceGraph graph = (GraphicsMemoryTraceGraph) memTrace
+ .getTraceGraph(i);
+ graph.action("private_shared_on"); //$NON-NLS-1$
+ }
+ GraphicsMemoryPlugin.getDefault().updateMenuItems();
+ }
+ };
+ actionShowBothItem.setText(Messages
+ .getString("GraphicsMemoryPlugin.showAll")); //$NON-NLS-1$
+
+ actionArrayList.add(actionShowPrivate);
+ actionArrayList.add(actionShowShared);
+ actionArrayList.add(actionShowBothItem);
+
+ // check which drawing mode is selected and set its action's state to
+ // checked
+ boolean showPrivate = isShowPrivateEnabled();
+ boolean showShared = isShowSharedEnabled();
+
+ if (showPrivate && !showShared) {
+ actionShowPrivate.setChecked(true);
+ } else if (showShared && !showPrivate) {
+ actionShowShared.setChecked(true);
+ } else {
+ actionShowBothItem.setChecked(true);
+ }
+
+ return actionArrayList.toArray(new Action[actionArrayList.size()]);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.carbide.cpp.internal.pi.plugin.model.ITitleBarMenu#getContextHelpId
+ * ()
+ */
+ public String getContextHelpId() {
+ return GraphicsMemoryPlugin.HELP_CONTEXT_ID_MAIN_PAGE;
+ }
+
+ /**
+ * Function for checking if private view is enabled
+ *
+ * @return boolean value that is true when private view is enabled
+ */
+
+ private boolean isShowPrivateEnabled() {
+ // if there is a showPrivate value associated with the current Analyser
+ // tab, then use it
+ Object obj = NpiInstanceRepository.getInstance()
+ .activeUidGetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showPrivate"); //$NON-NLS-1$
+ if ((obj != null) && (obj instanceof Boolean))
+ // retrieve the current value
+ return true;
+ else
+ // set the initial value
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showPrivate", true); //$NON-NLS-1$
+ return false;
+ }
+
+ /**
+ * Function for checking if shared view is enabled
+ *
+ * @return boolean value that is true when shared view is enabled
+ */
+ private boolean isShowSharedEnabled() {
+ // if there is a showShared value associated with the current
+ // Analyser tab, then use it
+ Object obj = NpiInstanceRepository.getInstance()
+ .activeUidGetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showShared"); //$NON-NLS-1$
+ if ((obj != null) && (obj instanceof Boolean))
+ // retrieve the current value
+ return true;
+ else
+ // set the initial value
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ GraphicsMemoryPlugin.PLUGIN_ID + ".showShared", true); //$NON-NLS-1$
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seecom.nokia.carbide.cpp.internal.pi.visual.GenericTraceGraph#
+ * setLegendTableVisible(boolean)
+ */
+ public void graphVisibilityChanged(boolean value) {
+ if (holder != null) {
+ holder.setVisible(value);
+ holder.getParent().layout();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seecom.nokia.carbide.cpp.internal.pi.visual.GenericTraceGraph#
+ * setLegendTableMaximized(boolean)
+ */
+ public void graphMaximized(boolean value) {
+ if (holder != null) {
+ if (holder.getParent().getClass() == SashForm.class) {
+ SashForm sashForm = (SashForm) holder.getParent();
+ if (value) {
+ sashForm.setMaximizedControl(holder);
+ } else {
+ sashForm.setMaximizedControl(null);
+
+ }
+ }
+
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seecom.nokia.carbide.cpp.internal.pi.visual.GenericTraceGraph#
+ * isGraphMinimizedWhenOpened()
+ */
+ public boolean isGraphMinimizedWhenOpened() {
+ // Memory Graph is shown when view is opened
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.carbide.cpp.pi.visual.IGenericTraceGraph#getTitle()
+ */
+ @Override
+ public String getTitle() {
+ return Messages.getString("GraphicsMemoryPlugin.pluginTitle"); //$NON-NLS-1$
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/GraphicsMemoryTraceParser.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.nokia.carbide.cpp.internal.pi.model.GenericSampledTrace;
+import com.nokia.carbide.cpp.internal.pi.model.ParsedTraceData;
+import com.nokia.carbide.cpp.internal.pi.model.Parser;
+import com.nokia.carbide.cpp.pi.util.GeneralMessages;
+
+public class GraphicsMemoryTraceParser extends Parser {
+ private boolean debug = false;
+ private String version;
+
+ private GraphicsMemoryTrace memTrace;
+ private int readCount = 0;
+
+ // constants
+ public final static int SAMPLE_TOTAL_MEMORY_PROCESS_ID = -1;
+ public final static String SAMPLE_TOTAL_MEMORY_PROCESS_NAME = "TOTAL_MEMORY_USAGE"; //$NON-NLS-1$
+
+ public ParsedTraceData parse(File file) throws IOException {
+ if (!file.exists() || file.isDirectory()) {
+ throw new IOException(Messages
+ .getString("GraphicsMemoryTraceParser.cannotOpenTraceFile")); //$NON-NLS-1$
+ }
+ if (debug)
+ System.out
+ .println(Messages
+ .getString("GraphicsMemoryTraceParser.traceFileLength") + file.length()); //$NON-NLS-1$
+
+ parseMemTrace(file);
+ int versionNumber = convertVersionStringToInt(version);
+ memTrace.setVersion(versionNumber);
+
+ ParsedTraceData ptd = new ParsedTraceData();
+ ptd.traceData = this.getTrace();
+
+ return ptd;
+ }
+
+ private void parseV100GPUFile(DataInputStream dis) throws IOException {
+ // read the version again
+ byte[] version = readElementWithLength(dis);
+ if (debug)
+ System.out
+ .println(Messages
+ .getString("GraphicsMemoryTraceParser.readVersionDebug") + new String(version)); //$NON-NLS-1$
+ this.version = new String(version);
+
+ this.readV100GPUSample(dis);
+ }
+
+ public String getProfilerVersion() {
+ return version;
+ }
+
+ private void readV100GPUSample(DataInputStream dis) throws IOException {
+ memTrace = new GraphicsMemoryTrace();
+
+ GraphicsMemoryProcess process;
+
+ // read sample header length
+ dis.readUnsignedByte();
+ readCount++;
+
+ int length;
+ int mode = -1;
+ String processName = null;
+ GraphicsMemorySample gpuSample = null;
+ int usedMemory = -1;
+ int totalMemory = -1;
+ long sample = -1;
+
+ List<GraphicsMemoryProcess> processList = new ArrayList<GraphicsMemoryProcess>();
+ try {
+
+ while (true) {
+ length = dis.readUnsignedByte();
+ readCount++;
+ if (length == 1) {
+ mode = dis.readUnsignedByte();
+ readCount++;
+ } else {
+ throw new IOException(Messages
+ .getString("GraphicsMemoryTraceParser.wrongLength")); //$NON-NLS-1$
+ }
+
+ if (mode == 0xac) { // time stamp
+ // first there should be 4 bytes of sample time
+ sample = this.readTUint(dis);
+ }
+
+ else if (mode == 0xaa) { // process name
+ length = dis.readUnsignedByte();
+ readCount++; // process sample length
+ // reading process name
+ processName = readProcessName(dis, length);
+ } else if (mode == 0xab) { // process id
+ // reading process id
+ long processId = readTUint(dis);
+ // create process and sample
+ process = new GraphicsMemoryProcess(Integer
+ .valueOf((int) processId), processName);
+ gpuSample = new GraphicsMemorySample(process, (int) sample);
+
+ } else if (mode == 0xdb) { // total GPU data
+ // read the total GPU data
+ long total = readTUint(dis);
+ totalMemory = (int) total;
+
+ } else if (mode == 0xdc) { // used GPU data
+ // read the used GPU data
+ long used = readTUint(dis);
+ usedMemory = (int) used;
+
+ if (debug)
+ System.out
+ .println(MessageFormat
+ .format(
+ Messages
+ .getString("GraphicsMemoryTraceParser.readMemoryUsageDebug"), usedMemory, totalMemory, sample)); //$NON-NLS-1$
+ GraphicsMemorySample memoryUsageSample = new GraphicsMemorySample(
+ usedMemory, totalMemory, (int) sample);
+ memTrace.addSample(memoryUsageSample);
+ processList.add(memoryUsageSample.process);
+
+ length = dis.readUnsignedByte(); // read process sample
+ // length
+ readCount++;
+
+ } else if (mode == 0xde) { // private data
+ // read the private data
+ long privateSize = readTUint(dis);
+ gpuSample.privateSize = (int) privateSize;
+ } else if (mode == 0xdf) { // shared data
+ // read the shared data
+ long sharedSize = readTUint(dis);
+ gpuSample.sharedSize = (int) sharedSize;
+
+ if (debug)
+ System.out
+ .println(MessageFormat
+ .format(
+ Messages
+ .getString("GraphicsMemoryTraceParser.readProcessDebug"), gpuSample.process.processName, gpuSample.sampleSynchTime, Long.toHexString(gpuSample.process.processId), gpuSample.privateSize, gpuSample.sharedSize)); //$NON-NLS-1$
+
+ memTrace.addSample(gpuSample);
+ processList.add(gpuSample.process);
+
+ length = dis.readUnsignedByte(); // read process sample
+ // length
+ readCount++;
+ } else {
+ throw new IOException(
+ Messages
+ .getString("GraphicsMemoryTraceParser.wrongMode") + mode); //$NON-NLS-1$
+ }
+ }
+ } catch (EOFException e) {
+ memTrace.setProcesses(processList
+ .toArray(new GraphicsMemoryProcess[processList.size()]));
+ System.out.println(Messages
+ .getString("GraphicsMemoryTraceParser.finishedReading")); //$NON-NLS-1$
+ }
+ }
+
+ /*
+ * A method for calculating hash value for a string
+ */
+ public static long sum(String arg) {
+ int total = 0;
+ for (int i = 0; i < arg.length(); i++) {
+ total += (long) arg.charAt(i);
+ }
+ return total; // returns the sum of the chars after cast
+ }
+
+ private String readProcessName(DataInputStream dis, int length)
+ throws IOException {
+ if (length != 0) {
+ byte[] element = new byte[length];
+ dis.read(element, 0, length);
+ readCount += length;
+ return new String(element);
+ } else
+ return null;
+ }
+
+ private byte[] readElementWithLength(DataInputStream dis) throws IOException {
+ byte length = dis.readByte();
+ readCount++;
+ if (length != 0) {
+ byte[] element = new byte[length];
+ dis.read(element, 0, length);
+ readCount += length;
+ return element;
+ } else
+ return null;
+ }
+
+ private long readTUint(DataInputStream dis) throws IOException {
+ long result = dis.readUnsignedByte();
+ readCount++;
+ result += dis.readUnsignedByte() << 8;
+ readCount++;
+ result += dis.readUnsignedByte() << 16;
+ readCount++;
+ result += dis.readUnsignedByte() << 24;
+ readCount++;
+ return result;
+ }
+
+ private void parseMemTrace(File file) throws IOException {
+ DataInputStream dis = new DataInputStream(new FileInputStream(file));
+ byte[] traceArray = new byte[(int) file.length()];
+ dis.readFully(traceArray);
+
+ // test the graph mem trace version
+ String s = new String(traceArray, 1, traceArray[0]);
+ if (traceArray.length > 257) {
+ if (s.startsWith("Bappea_GPU_V1.00")) { //$NON-NLS-1$
+ ByteArrayInputStream bais = new ByteArrayInputStream(traceArray);
+ dis = new DataInputStream(bais);
+ this.parseV100GPUFile(dis);
+ return;
+ }
+ }
+ String version = s.substring(8, 12);
+ String traceType = s.substring(13, s.length());
+ System.out
+ .println(Messages
+ .getString("GraphicsMemoryTraceParser.foundVersion1") + version + Messages.getString("GraphicsMemoryTraceParser.foundVersion2") + traceType + Messages.getString("GraphicsMemoryTraceParser.foundVersion3")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ GeneralMessages
+ .showErrorMessage(Messages
+ .getString("GraphicsMemoryTraceParser.wrongTraceType1") + traceType + Messages.getString("GraphicsMemoryTraceParser.wrongTraceType2")); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new IOException(
+ Messages.getString("GraphicsMemoryTraceParser.wrongTraceType1") + traceType + Messages.getString("GraphicsMemoryTraceParser.wrongTraceType2")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+
+ private GenericSampledTrace getTrace() {
+ return (GenericSampledTrace) memTrace;
+ }
+
+ private int convertVersionStringToInt(String version) {
+ // Coverts version number from string to int
+ int i = 0;
+ int versionInt = 0;
+ String versionString = ""; //$NON-NLS-1$
+
+ // goes string thru and copies all digits into another string
+ while (i < version.length()) {
+ if (Character.isDigit(version.charAt(i))) {
+ versionString += version.charAt(i);
+ }
+ i++;
+
+ }
+ // convert string to int
+ try {
+ versionInt = Integer.parseInt(versionString);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return versionInt;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/MaxGraphicsMemoryItem.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+public class MaxGraphicsMemoryItem {
+ public long maxPrivate;
+ public long maxShared;
+ public long maxTotal;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.pi.graphicsmemory;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+public final class Messages {
+ private static final String BUNDLE_NAME = GraphicsMemoryPlugin.PLUGIN_ID+".messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.graphicsmemory/src/com/nokia/carbide/cpp/pi/graphicsmemory/messages.properties Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,91 @@
+GraphicsMemoryPlugin.1=Graphics Memory trace
+GraphicsMemoryPlugin.graphicsMemoryGraph=Graphics Memory Graph
+GraphicsMemoryPlugin.memoryStats=Graphics Memory Usage Statistics
+GraphicsMemoryPlugin.memoryStatsTooltip=Show graphics memory usage statistics for the selected interval
+GraphicsMemoryPlugin.namesProcess=Process
+GraphicsMemoryPlugin.pluginTitle=Graphics Memory Usage
+GraphicsMemoryProcessTable.kbFormat=\#,\#\#\#\#,\#\#\# KB
+GraphicsMemoryProcessTable.copyTable=Copy Table
+GraphicsMemoryProcessTable.SaveTable=Save Table...
+GraphicsMemoryProcessTable.saveCheckedSamples=Save Graphics Memory Samples for Checked Table Entries...
+GraphicsMemoryProcessTable.saveSamplesHeading=Time (ms),Process,Private (KB),Shared (KB)\n
+GraphicsMemoryProcessTable.memory=Memory
+GraphicsMemoryProcessTable.comma=,
+GraphicsMemoryProcessTable.title=Graphics Memory Usage
+GraphicsMemoryPlugin.showPrivate=Private Usage
+GraphicsMemoryPlugin.namesTotal=Total
+GraphicsMemoryTraceGraph.KBformat=\#\#,\#\#\#,\#\#\# KB
+GraphicsMemoryTraceGraph.MBformat=\#\#\#\#\#.0
+GraphicsMemoryPlugin.showAll=Private and Shared Usage
+GraphicsMemoryPlugin.showShared=Shared Usage
+GraphicsMemoryPlugin.namesAvgPrivate=Average Private
+GraphicsMemoryPlugin.namesAvgShared=Average Shared
+GraphicsMemoryPlugin.showAllTooltip=Show private and shared graphics memory usage
+GraphicsMemoryPlugin.dynamicRescale=Dynamically Rescale Based on Selected Processes
+GraphicsMemoryPlugin.dynamicRescaleTooltip=Rescale graph based on the currently selected processes
+GraphicsMemoryTraceParser.parsingDone=Memory trace parsing done
+GraphicsMemoryTraceParser.missingType=Parse error, type after sample missing
+GraphicsMemoryTraceParser.readingDone=Finished reading
+GraphicsMemoryTraceParser.sizeOfParse=Done parsing, size:
+GraphicsMemoryTraceGraph.byKB=\ KB
+GraphicsMemoryTraceGraph.byMB=\ MB
+GraphicsMemoryPlugin.traceProcessed=Graphics Memory trace parsed
+GraphicsMemoryTraceParser.foundVersion1=Found version
+GraphicsMemoryTraceParser.foundVersion2=\
+GraphicsMemoryTraceParser.foundVersion3=\ trace file
+GraphicsMemoryTraceGraph.totalTooltip1=s: private
+GraphicsMemoryTraceGraph.totalTooltip2=\ \ \ shared
+GraphicsMemoryTraceGraph.privateTooltip1=s: private
+GraphicsMemoryTraceGraph.privateTooltip2=KB
+GraphicsMemoryPlugin.showPrivateTooltip=Show only private graphics memory usage
+GraphicsMemoryTraceParser.traceFileLength=Memory trace file length
+GraphicsMemoryTraceParser.readVersionDebug=Read version
+GraphicsMemoryTraceParser.readVersion=Read version
+GraphicsMemoryTraceParser.finishedReading=Finished reading
+GraphicsMemoryTraceParser.parseErrorTUint1=Parse error, TUint length other than 32 bits (it is
+GraphicsMemoryTraceParser.parseErrorTUint2=\ )
+GraphicsMemoryTraceParser.readMemoryUsageDebug=Memory usage {0} / {1} at #{2}
+GraphicsMemoryTraceParser.readProcessDebug=Process name {0} at #{1} process id: {2} private size: {3} shared size: {4}
+GraphicsMemoryTraceParser.wrongTraceType1=Wrong trace type
+GraphicsMemoryTraceParser.wrongTraceType2=\ as memory trace file
+GraphicsMemoryTraceParser.wrongLength=Parse error, wrong length
+GraphicsMemoryTraceParser.wrongMode=Parse error, wrong mode
+GraphicsMemoryTraceParser.invalidTraceFile=Not valid memory trace file
+GraphicsMemoryTraceParser.invalidSampleNum=Invalid sample number:
+GraphicsMemoryTraceParser.invalidSample=Parse error, invalid memory sample
+GraphicsMemoryTraceGraph.traceDataNotFound=Memory trace data not found\!
+GraphicsMemoryTraceGraph.showTotalMemoryUsage=Show Total Graphics Memory Usage
+GraphicsMemoryTraceGraph.sharedTooltip1=s: shared
+GraphicsMemoryTraceGraph.sharedTooltip2=KB
+GraphicsMemoryTraceParser.shouldNotHappen=Should not happen, memory trace
+GraphicsMemoryPlugin.showSharedTooltip=Show only shared graphics memory usage
+GraphicsMemoryPlugin.showTotalMemoryUsageToolTip=Show total memory usage on the graph
+GraphicsMemoryTraceParser.parsingOldVersion=Parsing old (v.0.85 or older) type memory trace file
+GraphicsMemoryTraceGraph.byByte=\ B
+GraphicsMemoryTraceParser.cannotOpenTraceFile=Unable to open memory trace file
+GraphicsMemoryTraceParser.traceVersionException1=Memory trace format version
+GraphicsMemoryTraceParser.traceVersionException2=\ is not supported by this version of analyser
+GraphicsMemoryTraceGraph.processNoSamples1=Process
+GraphicsMemoryTraceParser.parseErrorTypeMissing=Memory trace parse error, type after sample missing
+GraphicsMemoryTraceParser.missingSampleNumber=Memory trace missing sample \#
+GraphicsMemoryTraceParser.missingSampleNum=Missing sample \#
+GraphicsMemoryTraceParser.parseErrorWrongLength=Memory trace parse error, wrong length
+GraphicsMemoryTraceGraph.processNoSamples=\ has no samples\!
+GraphicsMemoryTraceParser.parseErrorWrongMode=Memory trace parse error, wrong mode
+GraphicsMemoryTraceParser.invalidTraceFileOverflow=Not valid memory trace file, possible profiler Buffer Overflow during trace?
+GraphicsMemoryStatisticsDialog.KBformat=\#\#\#\#\#\#,\#\#0 KB
+GraphicsMemoryStatisticsDialog.BytesFormat=\ (\#\#\#\#\#\#\#\#\#\#\#\#\#,\#\#\# bytes)
+GraphicsMemoryStatisticsDialog.statistics=Graphics Memory Usage Statistics
+GraphicsMemoryStatisticsDialog.interval=Interval
+GraphicsMemoryStatisticsDialog.used=Used
+GraphicsMemoryStatisticsDialog.free=Free
+GraphicsMemoryStatisticsDialog.total=Total
+GraphicsMemoryStatisticsDialog.private=Private
+GraphicsMemoryStatisticsDialog.shared=Shared
+GraphicsMemoryStatisticsDialog.close=Close
+GraphicsMemoryStatisticsDialog.currentSelection=Current Selection
+GraphicsMemoryStatisticsDialog.interval1=s to
+GraphicsMemoryStatisticsDialog.interval2=s =
+GraphicsMemoryStatisticsDialog.interval3=s
+GraphicsMemoryStatisticsDialog.notRecorded=*not recorded*
+GraphicsMemoryStatisticsDialog.onDevice=On Device
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Dynamic Binaries
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.instr;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.instr.InstrPlugin
Bundle-Vendor: Nokia
Bundle-Localization: plugin
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/AdvancedMemoryMap.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/AdvancedMemoryMap.java Wed Jun 23 15:05:09 2010 +0300
@@ -67,7 +67,7 @@
return this.binReader;
}
- public void InsertSample(IttSample sample)
+ public void insertSample(IttSample sample)
{
if (this.ittTrace122 == null)
{
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/BinaryReader.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/BinaryReader.java Wed Jun 23 15:05:09 2010 +0300
@@ -233,7 +233,7 @@
// this is a checksum match
- checksumValues.add(Boolean.valueOf(true));
+ checksumValues.add(Boolean.TRUE);
}
else
{
@@ -253,7 +253,7 @@
// " pos:"+i+"!! "+pf.file.getAbsolutePath());
// this one is not a checksum match
- checksumValues.add(Boolean.valueOf(false));
+ checksumValues.add(Boolean.FALSE);
}
}
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/BinaryReader122.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/BinaryReader122.java Wed Jun 23 15:05:09 2010 +0300
@@ -77,7 +77,7 @@
parseAndProcessObyFile(fileName);
else if (fileName.toLowerCase().endsWith(".pkg")) //$NON-NLS-1$
{
- addFilesInPkg(fileName);
+ addFilesInPkg(fileName, currentFile.epocRoot);
}
else
{
@@ -120,7 +120,7 @@
return this.getHostNameToBinary().get(s);
}
- public void addFilesInPkg(String pkgName)
+ public void addFilesInPkg(String pkgName, String epocRoot)
{
long lineNumber = 0;
File pkgFile = new File(pkgName);
@@ -172,13 +172,19 @@
Binary binary = null;
localFile = line.substring(first+1,second);
+ if(localFile.charAt(0) == '/'){
+ localFile = localFile.replace('/', '\\');
+ }
String remoteFile = line.substring(third+3,fourth);
// .PKG is referring everything as root relative,
// sometime there is reference to $(EPOCROOT) too
// let's try to guess what it was. I hate windows drive letter
if (localFile.charAt(0) == '\\') {
- localFile = GuessAndFixPath.fixPath(localFile, "", pkgName); //$NON-NLS-1$
+ if(epocRoot == null){
+ epocRoot = "";
+ }
+ localFile = GuessAndFixPath.fixPath(localFile, epocRoot, pkgName); //$NON-NLS-1$
} else if (localFile.charAt(1) != ':') {
// not absolute drive, resolve relative to PKG file
File relativeMapFile = new File(pkgFile.getParent(), localFile);
@@ -291,7 +297,7 @@
}
// if it is code binary...
- GeneralMessages.PiLog(myMessage, GeneralMessages.WARNING);
+ GeneralMessages.piLog(myMessage, GeneralMessages.WARNING);
}
}
}
@@ -310,7 +316,7 @@
} catch (EOFException e) {
// good, that's the end of file, bail out peacefully
} catch (IOException e) {
- GeneralMessages.PiLog(Messages.getString("BinaryReader122.IOException.on") + obyFile, GeneralMessages.ERROR, e); //$NON-NLS-1$
+ GeneralMessages.piLog(Messages.getString("BinaryReader122.IOException.on") + obyFile, GeneralMessages.ERROR, e); //$NON-NLS-1$
}
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/InstrPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/InstrPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -165,4 +165,20 @@
public static ImageDescriptor getImageDescriptor(String path) {
return AbstractPiPlugin.imageDescriptorFromPlugin("com.nokia.carbide.cpp.pi.instr", path); //$NON-NLS-1$
}
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/IttTraceParser.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/IttTraceParser.java Wed Jun 23 15:05:09 2010 +0300
@@ -101,12 +101,12 @@
if (symbolFileParser.findBinaryNameForAddress(
itts.programCounter).endsWith(Messages.getString("IttTraceParser.binaryNotFound"))) //$NON-NLS-1$
{
- amm.InsertSample(itts);
+ amm.insertSample(itts);
}
}
else
{
- amm.InsertSample(itts);
+ amm.insertSample(itts);
}
i++;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/MapFile.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/MapFile.java Wed Jun 23 15:05:09 2010 +0300
@@ -42,20 +42,20 @@
private long referenceLineNumber;
private LinkedList<Function> functionData;
private ArrayList<Function> sortedFunctionData;
- private Long currentGccLibEndingOffset = new Long(0);
+ private Long currentGccLibEndingOffset = Long.valueOf(0);
private Function lastGccFunction = null;
// RVCT/RVDS map file line
- private static final Pattern rvctLinePattern = Pattern.compile("^\\p{Blank}*((?!\\d)\\S.+)\\p{Blank}+(0[x|X]\\p{XDigit}+|\\d+)\\p{Blank}+(?:ARM Code|Thumb Code)\\p{Blank}+(0x\\p{XDigit}+|\\d+)\\p{Blank}.*\\(\\.text\\)$"); //$NON-NLS-1$
+ private static final Pattern RVCT_LINE_PATTERN = Pattern.compile("^\\p{Blank}*((?!\\d)\\S.+)\\p{Blank}+(0[x|X]\\p{XDigit}+|\\d+)\\p{Blank}+(?:ARM Code|Thumb Code)\\p{Blank}+(0x\\p{XDigit}+|\\d+)\\p{Blank}.*\\(\\.text\\)$"); //$NON-NLS-1$
// a GCC map file line looks like this:
// <%x|%d> <symbol name> for function symbols
// symbol name cannot be number (e.g. first non space is not a digit)
- private static final Pattern gccFuncLinePattern = Pattern.compile("\\p{Blank}*(0[x|X]\\p{XDigit}+|\\d+)\\p{Blank}+((?!\\d)\\S.+)"); //$NON-NLS-1$
+ private static final Pattern GCC_FUNC_LINE_PATTERN = Pattern.compile("\\p{Blank}*(0[x|X]\\p{XDigit}+|\\d+)\\p{Blank}+((?!\\d)\\S.+)"); //$NON-NLS-1$
// <section> <%x|%d> <%x|%d> <symbol name> for whole library
// *fill* <%x|%d> <%x|%d> 00000000 for filler
- private static final Pattern gccLibOrFillerLinePattern = Pattern.compile("\\p{Blank}*(?:\\S*)\\p{Blank}*(0[x|X]\\p{XDigit}+|\\d+)\\p{Blank}+(0[x|X]\\p{XDigit}+|\\d+)\\p{Blank}+(\\S.+)"); //$NON-NLS-1$
+ private static final Pattern GCC_LIB_OR_FILLER_LINE_PATTERN = Pattern.compile("\\p{Blank}*(?:\\S*)\\p{Blank}*(0[x|X]\\p{XDigit}+|\\d+)\\p{Blank}+(0[x|X]\\p{XDigit}+|\\d+)\\p{Blank}+(\\S.+)"); //$NON-NLS-1$
private static final String EXPORTED = " (EXPORTED)";
@@ -195,7 +195,7 @@
return -1;
}
- private Function FunctionFromTokens(String funcNameToken, String funcOffsetToken, String funcLengthToken)
+ private Function functionFromTokens(String funcNameToken, String funcOffsetToken, String funcLengthToken)
{
Function f = new Function(funcNameToken,Long.valueOf(0),null);
// look for length, set it tentatively
@@ -289,7 +289,7 @@
// a RVCT symbol line looks like this:
// <symbol name> <%x|%d> <ARM Code|Thumb Code> <%x|%d> <object>
// symbol name cannot be number (e.g. first non space is not a digit)
- Matcher rvctLineMatcher = rvctLinePattern.matcher(line);
+ Matcher rvctLineMatcher = RVCT_LINE_PATTERN.matcher(line);
if (rvctLineMatcher.matches())
{
@@ -308,7 +308,7 @@
String funcLengthToken = rvctLineMatcher.group(3).trim();
- Function f = FunctionFromTokens(funcNameToken, funcOffsetToken, funcLengthToken);
+ Function f = functionFromTokens(funcNameToken, funcOffsetToken, funcLengthToken);
this.insertToFunctionData(f);
}
@@ -350,10 +350,10 @@
// a GCC symbol line looks like this:
// <%x|%d> <symbol name> for function symbols
// symbol name cannot be number (e.g. first non space is not a digit)
- Matcher gccFuncLineMatcher = gccFuncLinePattern.matcher(line); //$NON-NLS-1$
+ Matcher gccFuncLineMatcher = GCC_FUNC_LINE_PATTERN.matcher(line); //$NON-NLS-1$
// <section> <%x|%d> <%x|%d> <symbol name> for whole library
// *fill* <%x|%d> <%x|%d> 00000000 for filler
- Matcher gccLibOrFillerLineMatcher = gccLibOrFillerLinePattern.matcher(line); //$NON-NLS-1$
+ Matcher gccLibOrFillerLineMatcher = GCC_LIB_OR_FILLER_LINE_PATTERN.matcher(line); //$NON-NLS-1$
Function f = null;
Long currentLineOffset = currentGccLibEndingOffset;
@@ -365,7 +365,7 @@
String funcOffsetToken = gccFuncLineMatcher.group(1).trim();
String funcLengthToken = Messages.getString("MapFile.zero"); //$NON-NLS-1$
- f = FunctionFromTokens(funcNameToken, funcOffsetToken, funcLengthToken);
+ f = functionFromTokens(funcNameToken, funcOffsetToken, funcLengthToken);
// Some GCC symbol may be bogus
if (qualifyGCCSymbol(f.getOffsetFromBinaryStart(), funcNameToken)) {
@@ -387,7 +387,7 @@
currentGccLibEndingOffset = Long.decode(libLengthToken) + Long.decode(libOffsetToken);
} else {
// next time around we will use the new library offset
- currentGccLibEndingOffset = new Long(0);
+ currentGccLibEndingOffset = Long.valueOf(0);
}
// update last function's size if needed
@@ -508,7 +508,7 @@
myMessage += Messages.getString("MapFile.line.number") + referenceLineNumber; //$NON-NLS-1$
}
- GeneralMessages.PiLog(myMessage, GeneralMessages.WARNING);
+ GeneralMessages.piLog(myMessage, GeneralMessages.WARNING);
}
private void flagIOException(File file, String referencePath, long referenceLineNumber) {
@@ -521,6 +521,6 @@
}
GeneralMessages.showErrorMessage(myMessage);
- GeneralMessages.PiLog(myMessage, GeneralMessages.ERROR);
+ GeneralMessages.piLog(myMessage, GeneralMessages.ERROR);
}
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.instr.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/UndecidedPool.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/UndecidedPool.java Wed Jun 23 15:05:09 2010 +0300
@@ -181,7 +181,7 @@
this.processedMostHits = 0;
this.processedUndecided = false;
- Object o = this.samplesForLocations.get(new Long(startAddress));
+ Object o = this.samplesForLocations.get(Long.valueOf(startAddress));
if (o != null)
{
@@ -219,7 +219,7 @@
//System.out.println("Added unique sample "+sample.programCounter+" to "+this.binary.binaryName);
Vector sampleVec = new Vector();
sampleVec.add(sample);
- samplesForLocations.put(new Long(startAddress),sampleVec);
+ samplesForLocations.put(Long.valueOf(startAddress),sampleVec);
}
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ipc/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ipc/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Interconnect Performance Counters PI Plugin
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.ipc;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.ipc.IpcPlugin
Bundle-Vendor: Nokia
Require-Bundle: org.eclipse.ui,
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ipc/src/com/nokia/carbide/cpp/pi/internal/ipc/IpcTraceParser.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ipc/src/com/nokia/carbide/cpp/pi/internal/ipc/IpcTraceParser.java Wed Jun 23 15:05:09 2010 +0300
@@ -47,32 +47,32 @@
long time = 0;
- private static final Map<Integer, String> eventTypeTable = new HashMap<Integer, String>();
+ private static final Map<Integer, String> EVENT_TYPE_TABLE = new HashMap<Integer, String>();
static {
- eventTypeTable.put(0x0,Messages.IpcTraceParser_1);
- eventTypeTable.put(0x1,Messages.IpcTraceParser_2);
- eventTypeTable.put(0x2,Messages.IpcTraceParser_3);
- eventTypeTable.put(0x3,Messages.IpcTraceParser_4);
- eventTypeTable.put(0x4,Messages.IpcTraceParser_5);
+ EVENT_TYPE_TABLE.put(0x0,Messages.IpcTraceParser_1);
+ EVENT_TYPE_TABLE.put(0x1,Messages.IpcTraceParser_2);
+ EVENT_TYPE_TABLE.put(0x2,Messages.IpcTraceParser_3);
+ EVENT_TYPE_TABLE.put(0x3,Messages.IpcTraceParser_4);
+ EVENT_TYPE_TABLE.put(0x4,Messages.IpcTraceParser_5);
}
- private static final Map<Integer, String> counterTypeTable = new HashMap<Integer, String>();
+ private static final Map<Integer, String> COUNTER_TYPE_TABLE = new HashMap<Integer, String>();
static {
- counterTypeTable.put(0x0,Messages.IpcTraceParser_6);
- counterTypeTable.put(0x1,Messages.IpcTraceParser_7);
- counterTypeTable.put(0x2,Messages.IpcTraceParser_8);
- counterTypeTable.put(0x3,Messages.IpcTraceParser_9);
- counterTypeTable.put(0x4,Messages.IpcTraceParser_10);
- counterTypeTable.put(0x5,Messages.IpcTraceParser_11);
+ COUNTER_TYPE_TABLE.put(0x0,Messages.IpcTraceParser_6);
+ COUNTER_TYPE_TABLE.put(0x1,Messages.IpcTraceParser_7);
+ COUNTER_TYPE_TABLE.put(0x2,Messages.IpcTraceParser_8);
+ COUNTER_TYPE_TABLE.put(0x3,Messages.IpcTraceParser_9);
+ COUNTER_TYPE_TABLE.put(0x4,Messages.IpcTraceParser_10);
+ COUNTER_TYPE_TABLE.put(0x5,Messages.IpcTraceParser_11);
}
- private static final Map<Integer, String> l2EventTypeTable = new HashMap<Integer, String>();
+ private static final Map<Integer, String> L2_EVENT_TYPE_TABLE = new HashMap<Integer, String>();
static {
- l2EventTypeTable.put(0x3,Messages.IpcTraceParser_12);
- l2EventTypeTable.put(0x4,Messages.IpcTraceParser_13);
- l2EventTypeTable.put(0x5,Messages.IpcTraceParser_14);
- l2EventTypeTable.put(0x6,Messages.IpcTraceParser_15);
- l2EventTypeTable.put(0x7,Messages.IpcTraceParser_16);
- l2EventTypeTable.put(0xC,Messages.IpcTraceParser_17);
- l2EventTypeTable.put(0xD,Messages.IpcTraceParser_18);
+ L2_EVENT_TYPE_TABLE.put(0x3,Messages.IpcTraceParser_12);
+ L2_EVENT_TYPE_TABLE.put(0x4,Messages.IpcTraceParser_13);
+ L2_EVENT_TYPE_TABLE.put(0x5,Messages.IpcTraceParser_14);
+ L2_EVENT_TYPE_TABLE.put(0x6,Messages.IpcTraceParser_15);
+ L2_EVENT_TYPE_TABLE.put(0x7,Messages.IpcTraceParser_16);
+ L2_EVENT_TYPE_TABLE.put(0xC,Messages.IpcTraceParser_17);
+ L2_EVENT_TYPE_TABLE.put(0xD,Messages.IpcTraceParser_18);
}
/* (non-Javadoc)
@@ -346,10 +346,10 @@
}
private String[] parseValueTypes(List<Integer> counterTypes, List<Integer> counterL2Types){
- String[] s = new String[counterTypes.size() * eventTypeTable.size() + (counterL2Types == null ? 0 : counterL2Types.size())];
+ String[] s = new String[counterTypes.size() * EVENT_TYPE_TABLE.size() + (counterL2Types == null ? 0 : counterL2Types.size())];
int k = 0;
- for (int i = 0; i < eventTypeTable.size(); i++) {
- String eventType = eventTypeTable.get(i);
+ for (int i = 0; i < EVENT_TYPE_TABLE.size(); i++) {
+ String eventType = EVENT_TYPE_TABLE.get(i);
for (Integer counterType : counterTypes) {
s[k] = String.format(Messages.IpcTraceParser_20, eventType, convertCounterType(counterType));
k++;
@@ -366,7 +366,7 @@
}
private String convertL2EventType(Integer value) {
- String s = IpcTraceParser.l2EventTypeTable.get(value);
+ String s = IpcTraceParser.L2_EVENT_TYPE_TABLE.get(value);
if (s == null) {
s = String.format(IPC_EVENT_NOT_RECOGNISED, value);
}
@@ -374,7 +374,7 @@
}
private String convertCounterType(Integer value) {
- String s = IpcTraceParser.counterTypeTable.get(value);
+ String s = IpcTraceParser.COUNTER_TYPE_TABLE.get(value);
if (s == null) {
s = String.format(IPC_EVENT_NOT_RECOGNISED, value);
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ipc/src/com/nokia/carbide/cpp/pi/internal/ipc/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ipc/src/com/nokia/carbide/cpp/pi/internal/ipc/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
import org.eclipse.osgi.util.NLS;
-public class Messages extends NLS {
+public final class Messages extends NLS {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.internal.ipc.messages"; //$NON-NLS-1$
public static String IpcSample_0;
public static String IpcTraceParser_0;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ipc/src/com/nokia/carbide/cpp/pi/ipc/IpcPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ipc/src/com/nokia/carbide/cpp/pi/ipc/IpcPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -56,7 +56,7 @@
// The shared instance
private static IpcPlugin plugin;
- private static final Map<Integer, PecCommonGuiManager> guiManagerMap = new HashMap<Integer, PecCommonGuiManager>();
+ private static final Map<Integer, PecCommonGuiManager> GUI_MANAGER_MAP = new HashMap<Integer, PecCommonGuiManager>();
/**
* The constructor
@@ -122,7 +122,7 @@
//create the GUI class which manages the graphs
int uid = NpiInstanceRepository.getInstance().activeUid();
- guiManagerMap.put(uid, new PecCommonGuiManager(uid, parsedTrace, IpcPlugin.GRAPH_COUNT, Messages.IpcPlugin_0));
+ GUI_MANAGER_MAP.put(uid, new PecCommonGuiManager(uid, parsedTrace, IpcPlugin.GRAPH_COUNT, Messages.IpcPlugin_0));
}
/* (non-Javadoc)
@@ -245,7 +245,7 @@
*/
public IGenericTraceGraph getTraceGraph(int graphIndex) {
int uid = NpiInstanceRepository.getInstance().activeUid();
- PecCommonGuiManager guiManager = guiManagerMap.get(uid);
+ PecCommonGuiManager guiManager = GUI_MANAGER_MAP.get(uid);
if (guiManager != null){
return guiManager.getTraceGraph(graphIndex, HELP_CONTEXT_ID_MAIN_PAGE);
@@ -294,7 +294,7 @@
// Do any cleanup work here when the editor closes
int uid = NpiInstanceRepository.getInstance().activeUid();
- guiManagerMap.remove(uid);
+ GUI_MANAGER_MAP.remove(uid);
}
/* (non-Javadoc)
@@ -315,6 +315,20 @@
}
return null;
}
-
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ipc/src/com/nokia/carbide/cpp/pi/ipc/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ipc/src/com/nokia/carbide/cpp/pi/ipc/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
import org.eclipse.osgi.util.NLS;
-public class Messages extends NLS {
+public final class Messages extends NLS {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.ipc.messages"; //$NON-NLS-1$
public static String IpcPlugin_0;
public static String IpcPlugin_1;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.irq/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.irq/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator IRQ plug-in
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.irq;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.irq.IrqPlugin
Bundle-Vendor: Nokia
Require-Bundle: org.eclipse.ui,
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.irq/src/com/nokia/carbide/cpp/pi/irq/IrqPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.irq/src/com/nokia/carbide/cpp/pi/irq/IrqPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -332,5 +332,21 @@
public void setPagesCreated(boolean pagesCreated) {
return;
}
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.irq/src/com/nokia/carbide/cpp/pi/irq/IrqTrace.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.irq/src/com/nokia/carbide/cpp/pi/irq/IrqTrace.java Wed Jun 23 15:05:09 2010 +0300
@@ -144,7 +144,7 @@
// Get that contains name for thread
ArrayList al = ptd.staticData.getColumnMatch(Messages.IrqTrace_1,
- Messages.IrqTrace_2, new Long(sample.getThreadValue()));
+ Messages.IrqTrace_2, Long.valueOf(sample.getThreadValue()));
if (al.size() > 0) {
return (String) al.get(0);
} else {
@@ -264,20 +264,20 @@
}
}
// if thread is not yet found from threadToOffset
- if (!this.threadToOffset.containsKey(new Long(sample
+ if (!this.threadToOffset.containsKey(Long.valueOf(sample
.getThreadValue()))) {
- this.threadToOffset.put(new Long(sample.getThreadValue()),
+ this.threadToOffset.put(Long.valueOf(sample.getThreadValue()),
Integer.valueOf(swiOffset++));
// read thread names from trace if needed
if (readThreadNamesFromTrace) {
try {
- this.threadToName.put(new Long(sample
+ this.threadToName.put(Long.valueOf(sample
.getThreadValue()), this
.getThreadName(sample));
} catch (NullPointerException e1) {
this.threadToName
- .put(new Long(sample.getThreadValue()),
+ .put(Long.valueOf(sample.getThreadValue()),
Messages.IrqTrace_6
+ Long.toHexString(sample
.getThreadValue()));
@@ -286,7 +286,7 @@
// create thread wrapper for the thread and add it to allThreadWrappers
SwiThreadWrapper wrapper = new SwiThreadWrapper();
- wrapper.threadAddress = new Long(sample.getThreadValue());
+ wrapper.threadAddress = Long.valueOf(sample.getThreadValue());
wrapper.threadName = threadToName.get(sample
.getThreadValue());
this.allThreadWrappers.add(wrapper);
@@ -297,8 +297,8 @@
val = sample.getIrqL1Value() + (sample.getIrqL2Value() << 8);
table = irqTable;
- if (!this.irqToOffset.containsKey(new Long(val))) {
- this.irqToOffset.put(new Long(val),
+ if (!this.irqToOffset.containsKey(Long.valueOf(val))) {
+ this.irqToOffset.put(Long.valueOf(val),
Integer.valueOf(irqOffset++));
}
@@ -330,7 +330,7 @@
}
// Add interrupts into its sampleTypeWrapper or create one if needed
- valL = new Long(val);
+ valL = Long.valueOf(val);
if (!table.containsKey(valL)) {
IrqSampleTypeWrapper w = new IrqSampleTypeWrapper(sample,
colorSet, colorsOfThreadsAndLines);
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.irq/src/com/nokia/carbide/cpp/pi/irq/IrqTraceParser.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.irq/src/com/nokia/carbide/cpp/pi/irq/IrqTraceParser.java Wed Jun 23 15:05:09 2010 +0300
@@ -33,12 +33,12 @@
// private String profilerVersion;
private Vector completeIrqTrace;
private int firstSample,lastSample;
- private long old_1 = 0;
- private long old_2 = 0;
- private long old_3 = 0;
+ private long old1 = 0;
+ private long old2 = 0;
+ private long old3 = 0;
private int sampleNum = 0;
- private int old_irq_lev1 = 0;
- private int old_irq_lev2 = 0;
+ private int oldIrqLev1 = 0;
+ private int oldIrqLev2 = 0;
public IrqTraceParser(/*File irqFile, ProgressBar progressBar*/) throws Exception
{
@@ -268,8 +268,8 @@
if(length > 0)
{
- this.old_irq_lev1 = dis.readUnsignedByte();
- this.old_irq_lev2 = dis.readUnsignedByte();
+ this.oldIrqLev1 = dis.readUnsignedByte();
+ this.oldIrqLev2 = dis.readUnsignedByte();
length-=2; read-=2;
this.addIrqSample();
@@ -277,8 +277,8 @@
}
else
{
- this.old_irq_lev1 = firstByte;
- this.old_irq_lev2 = dis.readUnsignedByte();
+ this.oldIrqLev1 = firstByte;
+ this.oldIrqLev2 = dis.readUnsignedByte();
length--;read++;
this.addIrqSample();
@@ -339,7 +339,7 @@
}
}
//if(fValue == -1) System.out.println("1:"+fValue);
- this.old_1 += fValue;
+ this.old1 += fValue;
value = 0;
fValue = 0;
@@ -365,7 +365,7 @@
}
}
//if(fValue == -1) System.out.println("2:"+fValue);
- this.old_2 += fValue;
+ this.old2 += fValue;
value = 0;
fValue = 0;
@@ -391,7 +391,7 @@
}
}
//if(fValue == -1) System.out.println("3:"+fValue);
- this.old_3 += fValue;
+ this.old3 += fValue;
this.addSwiSample();
/*
@@ -404,9 +404,9 @@
private void addSwiSample()
{
- long temp_1 = ((this.old_1 << 32) >>> 32);
- long temp_2 = ((this.old_2 << 32) >>> 32);
- long temp_3 = ((this.old_3 << 32) >>> 32)-4;
+ long temp_1 = ((this.old1 << 32) >>> 32);
+ long temp_2 = ((this.old2 << 32) >>> 32);
+ long temp_3 = ((this.old3 << 32) >>> 32)-4;
IrqSample sample = new IrqSample(this.sampleNum, temp_1, temp_2, temp_3);
/*
@@ -433,9 +433,9 @@
private void addSwiRepeat(int amount)
{
- long temp_1 = ((this.old_1 << 32) >>> 32);
- long temp_2 = ((this.old_2 << 32) >>> 32);
- long temp_3 = ((this.old_3 << 32) >>> 32)-4;
+ long temp_1 = ((this.old1 << 32) >>> 32);
+ long temp_2 = ((this.old2 << 32) >>> 32);
+ long temp_3 = ((this.old3 << 32) >>> 32)-4;
/*
String n1 = sfp.getFunctionNameForAddress(temp_3);
@@ -464,13 +464,13 @@
private void addIrqSample()
{
- IrqSample sample = new IrqSample(this.sampleNum,this.old_irq_lev1,this.old_irq_lev2);
+ IrqSample sample = new IrqSample(this.sampleNum,this.oldIrqLev1,this.oldIrqLev2);
this.completeIrqTrace.add(sample);
}
private void addIrqRepeat(int amount)
{
- IrqSample sample = new IrqSample(this.sampleNum,this.old_irq_lev1,this.old_irq_lev2);
+ IrqSample sample = new IrqSample(this.sampleNum,this.oldIrqLev1,this.oldIrqLev2);
sample.repeatCount = amount;
this.completeIrqTrace.add(sample);
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.irq/src/com/nokia/carbide/cpp/pi/irq/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.irq/src/com/nokia/carbide/cpp/pi/irq/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -19,7 +19,7 @@
import org.eclipse.osgi.util.NLS;
-public class Messages extends NLS {
+public final class Messages extends NLS {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.irq.messages"; //$NON-NLS-1$
public static String IrqLineTable_0;
public static String IrqLineTable_1;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Memory Usage
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.memory;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.memory.MemoryPlugin
Bundle-Vendor: Nokia
Require-Bundle: org.eclipse.ui,
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/MemThreadTable.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/MemThreadTable.java Wed Jun 23 15:05:09 2010 +0300
@@ -538,7 +538,7 @@
private DecimalFormat decimalFormat = new DecimalFormat(Messages.getString("MemThreadTable.kbFormat")); //$NON-NLS-1$
- Table table;
+ private Table table;
public SharedLabelProvider(Table table) {
super();
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/MemTraceGraph.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/MemTraceGraph.java Wed Jun 23 15:05:09 2010 +0300
@@ -52,6 +52,7 @@
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
@@ -399,10 +400,24 @@
// calculate new x coord's value and round it to integer
int xCoord = (int) ((msbt.getTime()/getScale()) + 0.5);
int maxBytes;
- if (dynamicMemoryVisualisation)
- maxBytes = maxChunks;
- else
- maxBytes = memTrace.getTraceMaxChunks();
+ if (dynamicMemoryVisualisation) {
+ if (paintMode == UsageType.CHUNKS) {
+ maxBytes = maxChunks;
+ } else if (paintMode == UsageType.HEAPSTACK) {
+ maxBytes = maxStack;
+ } else {
+ maxBytes = maxStackHeap;
+ }
+ } else {
+ if (paintMode == UsageType.CHUNKS) {
+ maxBytes = memTrace.getTraceMaxChunks();
+ } else if (paintMode == UsageType.HEAPSTACK) {
+ maxBytes = memTrace.getTraceMaxStackHeap();
+ } else {
+ maxBytes = memTrace.getTraceMaxTotal();
+ }
+ }
+
int yMultiplier = prettyMaxBytes(maxBytes) / height;
// calculate new y-coord's value and round it to integer
int yCoord = (int) (((double) height - (double) msbt.getUsedMemory()
@@ -1262,6 +1277,9 @@
Rectangle rect = ((GraphComposite) figureCanvas.getParent()).figureCanvas
.getClientArea();
+
+ Combo titleCombo = ((GraphComposite) figureCanvas.getParent())
+ .getTitleBarCombo();
double visY = rect.height - MemTraceGraph.xLegendHeight;
@@ -1275,11 +1293,13 @@
maxBytes = maxChunks;
else
maxBytes = memTrace.getTraceMaxChunks();
+ titleCombo.select(0);
} else if (paintMode == UsageType.HEAPSTACK) {
if (dynamicMemoryVisualisation)
maxBytes = maxStack;
else
maxBytes = memTrace.getTraceMaxStackHeap();
+ titleCombo.select(1);
} else {
if (dynamicMemoryVisualisation)
maxBytes = maxChunks > maxStack ? maxChunks : maxStack;
@@ -1287,6 +1307,7 @@
maxBytes = memTrace.getTraceMaxChunks() > memTrace
.getTraceMaxStackHeap() ? memTrace.getTraceMaxChunks()
: memTrace.getTraceMaxStackHeap();
+ titleCombo.select(2);
}
double multiplier = 0;
@@ -1625,6 +1646,7 @@
.getTraceGraph(i);
graph.action("chunk_on"); //$NON-NLS-1$
}
+ MemoryPlugin.getDefault().updateMenuItems();
}
};
actionShowChunk.setText(Messages.getString("MemoryPlugin.showChunks")); //$NON-NLS-1$
@@ -1642,6 +1664,7 @@
.getTraceGraph(i);
graph.action("heapstack_on"); //$NON-NLS-1$
}
+ MemoryPlugin.getDefault().updateMenuItems();
}
};
actionShowHeap
@@ -1660,6 +1683,7 @@
.getTraceGraph(i);
graph.action("chunk_heapstack_on"); //$NON-NLS-1$
}
+ MemoryPlugin.getDefault().updateMenuItems();
}
};
actionShowBothItem.setText(Messages.getString("MemoryPlugin.showAll")); //$NON-NLS-1$
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/MemTraceParser.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/MemTraceParser.java Wed Jun 23 15:05:09 2010 +0300
@@ -22,6 +22,7 @@
import java.io.EOFException;
import java.io.File;
import java.io.FileInputStream;
+import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
@@ -61,20 +62,20 @@
private int readCount = 0;
// constants
- public static int SAMPLE_CODE_INITIAL_CHUNK = 0;
- public static int SAMPLE_CODE_NEW_CHUNK = 1;
- public static int SAMPLE_CODE_UPDATE_CHUNK = 2;
- public static int SAMPLE_CODE_DELETE_CHUNK = 3;
+ public final static int SAMPLE_CODE_INITIAL_CHUNK = 0;
+ public final static int SAMPLE_CODE_NEW_CHUNK = 1;
+ public final static int SAMPLE_CODE_UPDATE_CHUNK = 2;
+ public final static int SAMPLE_CODE_DELETE_CHUNK = 3;
public MemTraceParser() //throws Exception
{
}
- public ParsedTraceData parse(File file) throws Exception
+ public ParsedTraceData parse(File file) throws IOException
{
if (!file.exists() || file.isDirectory())
{
- throw new Exception(Messages.getString("MemTraceParser.cannotOpenTraceFile")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.cannotOpenTraceFile")); //$NON-NLS-1$
}
if (debug)
System.out.println(Messages.getString("MemTraceParser.traceFileLength") + file.length()); //$NON-NLS-1$
@@ -105,17 +106,17 @@
return ptd;
}
- private void parseNewMemFile(String version,DataInputStream dis) throws Exception
+ private void parseNewMemFile(String version,DataInputStream dis) throws IOException
{
if (version.equals("0.85") || version.equals("0.91") || version.equals("1.00")||version.equals("1.10")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
{
parseV085MemFile(dis);
}
- else throw new Exception(Messages.getString("MemTraceParser.traceVersionException1") + version //$NON-NLS-1$
+ else throw new IOException(Messages.getString("MemTraceParser.traceVersionException1") + version //$NON-NLS-1$
+ Messages.getString("MemTraceParser.traceVersionException2")); //$NON-NLS-1$
}
- private void parseV085MemFile(DataInputStream dis) throws Exception
+ private void parseV085MemFile(DataInputStream dis) throws IOException
{
// read the version again
byte[] version = readElementWithLength(dis);
@@ -125,7 +126,7 @@
this.readV085MemSample(dis);
}
- private void parseV110MemFile(DataInputStream dis) throws Exception
+ private void parseV110MemFile(DataInputStream dis) throws IOException
{
// read the version again
byte[] version = readElementWithLength(dis);
@@ -135,7 +136,7 @@
this.readV110MemSample(dis);
}
- private void parseV155MemFile(DataInputStream dis) throws Exception
+ private void parseV155MemFile(DataInputStream dis) throws IOException
{
// read the version again
byte[] version = readElementWithLength(dis);
@@ -145,7 +146,7 @@
this.readV155MemSample(dis);
}
- private void parseV157MemFile(DataInputStream dis) throws Exception
+ private void parseV157MemFile(DataInputStream dis) throws IOException
{
// read the version again
byte[] version = readElementWithLength(dis);
@@ -155,7 +156,7 @@
this.readV157MemSample(dis);
}
- private void parseV110PriFile(DataInputStream dis) throws Exception
+ private void parseV110PriFile(DataInputStream dis) throws IOException
{
// read the version again
byte[] version = readElementWithLength(dis);
@@ -170,7 +171,7 @@
return version;
}
- private void readV085MemSample(DataInputStream dis) throws Exception
+ private void readV085MemSample(DataInputStream dis) throws IOException
{
Vector<long[]> rawV085Samples = new Vector<long[]>();
Vector<long[]> lastSampleRaw = new Vector<long[]>();
@@ -184,7 +185,7 @@
// then read if there is thread name data
int length = dis.readUnsignedByte();readCount++;
if (length != 1)
- throw new Exception(Messages.getString("MemTraceParser.parseErrorTypeMissing")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.parseErrorTypeMissing")); //$NON-NLS-1$
int mode = dis.readUnsignedByte(); readCount++;
@@ -216,7 +217,7 @@
}
else if (length != 1)
{
- throw new Exception(Messages.getString("MemTraceParser.parseErrorWrongLength") + length); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.parseErrorWrongLength") + length); //$NON-NLS-1$
}
else
{
@@ -298,7 +299,7 @@
}
else
{
- throw new Exception(Messages.getString("MemTraceParser.parseErrorWrongMode") + mode); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.parseErrorWrongMode") + mode); //$NON-NLS-1$
}
}
}
@@ -309,7 +310,7 @@
}
}
- private void readV110MemSample(DataInputStream dis) throws Exception
+ private void readV110MemSample(DataInputStream dis) throws IOException
{
Vector<long[]> rawV110MemSamples = new Vector<long[]>();
Vector<long[]> lastSampleRaw = new Vector<long[]>();
@@ -322,7 +323,7 @@
// then read if there is thread name data
int length = dis.readUnsignedByte(); readCount++;
if (length != 1)
- throw new Exception(Messages.getString("MemTraceParser.parseErrorTypeMissing")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.parseErrorTypeMissing")); //$NON-NLS-1$
int mode = dis.readUnsignedByte(); readCount++;
@@ -350,7 +351,7 @@
}
else if (length != 1)
{
- throw new Exception(Messages.getString("MemTraceParser.parseErrorWrongLength") + length); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.parseErrorWrongLength") + length); //$NON-NLS-1$
}
else
{
@@ -430,7 +431,7 @@
}
else
{
- throw new Exception(Messages.getString("MemTraceParser.parseErrorWrongMode")+mode); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.parseErrorWrongMode")+mode); //$NON-NLS-1$
}
}
}
@@ -441,7 +442,7 @@
}
}
- private void readV155MemSample(DataInputStream dis) throws Exception
+ private void readV155MemSample(DataInputStream dis) throws IOException
{
Vector<long[]> rawV155MemSamples = new Vector<long[]>();
Vector<long[]> lastSampleRaw = new Vector<long[]>();
@@ -453,7 +454,7 @@
// then read if there is thread name data
int length = dis.readUnsignedByte();readCount++;
- if (length != 1) throw new Exception(Messages.getString("MemTraceParser.missingType")); //$NON-NLS-1$
+ if (length != 1) throw new IOException(Messages.getString("MemTraceParser.missingType")); //$NON-NLS-1$
int mode = dis.readUnsignedByte();readCount++;
@@ -482,7 +483,7 @@
}
else if (length != 1)
{
- throw new Exception(Messages.getString("MemTraceParser.wrongLength")+length); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.wrongLength")+length); //$NON-NLS-1$
}
else
{
@@ -570,7 +571,7 @@
}
else
{
- throw new Exception(Messages.getString("MemTraceParser.wrongMode")+mode); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.wrongMode")+mode); //$NON-NLS-1$
}
}
}
@@ -582,7 +583,7 @@
}
@SuppressWarnings("unchecked")
- private void readV157MemSample(DataInputStream dis) throws Exception {
+ private void readV157MemSample(DataInputStream dis) throws IOException {
Vector rawV157MemSamples = new Vector();
int counter = 0;
String createdThread = "";
@@ -596,7 +597,7 @@
// then read if there is thread name data
int length = dis.readUnsignedByte();readCount++;
- if(length != 1) throw new Exception("Parse error, type after sample missing");
+ if(length != 1) throw new IOException("Parse error, type after sample missing");
int mode = dis.readUnsignedByte();readCount++;
@@ -620,7 +621,7 @@
mode = 0x00;
}
else if(length != 1) {
- throw new Exception("Parse error, wrong length "+length+", readCount: "+readCount);
+ throw new IOException("Parse error, wrong length "+length+", readCount: "+readCount);
}
// else {
// lastSampleRaw.clear();
@@ -740,7 +741,7 @@
}
else
{
- throw new Exception("Parse error, wrong mode "+mode);
+ throw new IOException("Parse error, wrong mode "+mode);
}
}
}
@@ -970,7 +971,7 @@
return time;
}
- private void addRawV155MemSamples(Vector<long[]> rawV155MemSamples) throws Exception
+ private void addRawV155MemSamples(Vector<long[]> rawV155MemSamples) throws IOException
{
//int largest = 0;
MemThread[] memTreads = new MemThread[memSamples.size()];
@@ -1015,7 +1016,7 @@
if (sampleTime % (samplingTime*2) != samplingTime) {
System.out.println(Messages.getString("MemTraceParser.invalidSampleNum") + sampleTime); //$NON-NLS-1$
- throw new Exception(Messages.getString("MemTraceParser.invalidSample")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.invalidSample")); //$NON-NLS-1$
}
}
}
@@ -1097,7 +1098,7 @@
if (debug) System.out.println(Messages.getString("MemTraceParser.parsingDone")); //$NON-NLS-1$
}
- private void readV110PriSample(DataInputStream dis) throws Exception
+ private void readV110PriSample(DataInputStream dis) throws IOException
{
Vector<long[]> rawV110PriSamples = new Vector<long[]>();
Vector<long[]> lastSampleRaw = new Vector<long[]>();
@@ -1111,7 +1112,7 @@
// then read if there is thread name data
int length = dis.readUnsignedByte(); readCount++;
if (length != 1)
- throw new Exception(Messages.getString("MemTraceParser.parseErrorTypeMissing")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.parseErrorTypeMissing")); //$NON-NLS-1$
int mode = dis.readUnsignedByte(); readCount++;
@@ -1142,7 +1143,7 @@
}
else if (length != 1)
{
- throw new Exception(Messages.getString("MemTraceParser.parseErrorWrongLength") + length); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.parseErrorWrongLength") + length); //$NON-NLS-1$
}
else
{
@@ -1222,7 +1223,7 @@
}
else
{
- throw new Exception(Messages.getString("MemTraceParser.parseErrorWrongMode") + mode); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.parseErrorWrongMode") + mode); //$NON-NLS-1$
}
}
}
@@ -1268,7 +1269,7 @@
if (debug) System.out.println(Messages.getString("MemTraceParser.parsingDone")); //$NON-NLS-1$
}
- private long[] readDataElements085Mem(DataInputStream dis,int length,long sampleTime) throws Exception
+ private long[] readDataElements085Mem(DataInputStream dis,int length,long sampleTime) throws IOException
{
if (length != 0)
{
@@ -1290,7 +1291,7 @@
}
}
- private long[] readDataElements110Mem(DataInputStream dis,int length,long sampleTime) throws Exception
+ private long[] readDataElements110Mem(DataInputStream dis,int length,long sampleTime) throws IOException
{
if (length != 0)
{
@@ -1314,7 +1315,7 @@
}
}
- private long[] readDataElements110Pri(DataInputStream dis, int length, long sampleTime) throws Exception
+ private long[] readDataElements110Pri(DataInputStream dis, int length, long sampleTime) throws IOException
{
if (length != 0)
{
@@ -1332,7 +1333,7 @@
}
}
- private String readThreadName(DataInputStream dis, int length) throws Exception
+ private String readThreadName(DataInputStream dis, int length) throws IOException
{
if (length != 0)
{
@@ -1347,7 +1348,7 @@
return null;
}
- private byte[] readElementWithLength(DataInputStream dis) throws Exception
+ private byte[] readElementWithLength(DataInputStream dis) throws IOException
{
byte length = dis.readByte(); readCount++;
if (length != 0)
@@ -1361,7 +1362,7 @@
else return null;
}
- private long readShort(DataInputStream dis) throws Exception
+ private long readShort(DataInputStream dis) throws IOException
{
long result = dis.readUnsignedByte();
readCount++;
@@ -1370,7 +1371,7 @@
return result;
}
- private long readTUint(DataInputStream dis) throws Exception
+ private long readTUint(DataInputStream dis) throws IOException
{
long result = dis.readUnsignedByte();
readCount++;
@@ -1383,14 +1384,14 @@
return result;
}
- private long readTUintWithLength(DataInputStream dis) throws Exception
+ private long readTUintWithLength(DataInputStream dis) throws IOException
{
byte length = (byte)dis.readUnsignedByte();
readCount++;
if (length != 4)
{
- throw new Exception(Messages.getString("MemTraceParser.parseErrorTUint1") + length + Messages.getString("MemTraceParser.parseErrorTUint2")); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new IOException(Messages.getString("MemTraceParser.parseErrorTUint1") + length + Messages.getString("MemTraceParser.parseErrorTUint2")); //$NON-NLS-1$ //$NON-NLS-2$
}
long result = dis.readUnsignedByte();
readCount++;
@@ -1404,7 +1405,7 @@
return result;
}
- private void parseMemTrace(File file) throws Exception
+ private void parseMemTrace(File file) throws IOException
{
DataInputStream dis = new DataInputStream(new FileInputStream(file));
byte[] traceArray = new byte[(int)file.length()];
@@ -1440,7 +1441,7 @@
if (!traceType.equals("MEM")) //$NON-NLS-1$
{
GeneralMessages.showErrorMessage(Messages.getString("MemTraceParser.wrongTraceType1") + traceType + Messages.getString("MemTraceParser.wrongTraceType2")); //$NON-NLS-1$ //$NON-NLS-2$
- throw new Exception(Messages.getString("MemTraceParser.wrongTraceType1") + traceType + Messages.getString("MemTraceParser.wrongTraceType2")); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new IOException(Messages.getString("MemTraceParser.wrongTraceType1") + traceType + Messages.getString("MemTraceParser.wrongTraceType2")); //$NON-NLS-1$ //$NON-NLS-2$
}
else
{
@@ -1468,7 +1469,7 @@
{
GeneralMessages.showErrorMessage(Messages.getString("MemTraceParser.invalidTraceFileOverflow")); //$NON-NLS-1$
System.out.println(Messages.getString("MemTraceParser.invalidTraceFile")); //$NON-NLS-1$
- throw new Exception(Messages.getString("MemTraceParser.invalidTraceFile")); //$NON-NLS-1$
+ throw new IOException(Messages.getString("MemTraceParser.invalidTraceFile")); //$NON-NLS-1$
}
memTrace = new MemTrace();
priTrace = new PriTrace();
@@ -1578,7 +1579,7 @@
}
- private void parseVersion110Trace(byte[] traceArray, String version_data) throws Exception
+ private void parseVersion110Trace(byte[] traceArray, String version_data) throws IOException
{
String version = version_data.substring(8, 12);
@@ -1599,7 +1600,7 @@
}
}
- private void parseVersion155Trace(byte[] traceArray, String version_data) throws Exception
+ private void parseVersion155Trace(byte[] traceArray, String version_data) throws IOException
{
if (version_data.indexOf("MEM")>0) //version 1.55 or newer //$NON-NLS-1$
{
@@ -1610,7 +1611,7 @@
}
}
- private void parseVersion157Trace(byte[] traceArray, String version_data) throws Exception
+ private void parseVersion157Trace(byte[] traceArray, String version_data) throws IOException
{
// String version = version_data.substring(8,12);
@@ -1716,7 +1717,7 @@
}
}
- private int findThreadListLength(DataInputStream dis, int traceLength) throws Exception
+ private int findThreadListLength(DataInputStream dis, int traceLength) throws IOException
{
char[] buf = new char[8];
for (int i = 0; i < traceLength / 8; i++)
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/MemoryPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/MemoryPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -18,6 +18,7 @@
package com.nokia.carbide.cpp.pi.memory;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;
@@ -56,6 +57,7 @@
{
private static final String HELP_CONTEXT_ID = PIPageEditor.PI_ID + ".memory"; //$NON-NLS-1$
public static final String HELP_CONTEXT_ID_MAIN_PAGE = HELP_CONTEXT_ID + ".memoryPageContext"; //$NON-NLS-1$
+ public static final String PLUGIN_ID = "com.nokia.carbide.cpp.pi.memory";
// There will be 1 graph for editor page 0
// This code may assume that page 0 has the threads graph
@@ -118,7 +120,7 @@
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractPiPlugin.imageDescriptorFromPlugin("com.nokia.carbide.cpp.pi.memory", path); //$NON-NLS-1$
+ return AbstractPiPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path); //$NON-NLS-1$
}
public Class getTraceClass()
@@ -128,28 +130,28 @@
public Class getReplacedClass(String className)
{
- if ( className.indexOf("com.nokia.carbide.cpp.pi.memory.MemTrace") != -1 //$NON-NLS-1$
+ if ( className.indexOf(PLUGIN_ID+".MemTrace") != -1 //$NON-NLS-1$
|| className.indexOf("com.nokia.carbide.pi.memory.MemTrace") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.model.MemTrace") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.memTracePlugin.MemTrace") != -1) //$NON-NLS-1$
{
return MemTrace.class;
}
- else if ( className.indexOf("com.nokia.carbide.cpp.pi.memory.MemSample") != -1 //$NON-NLS-1$
+ else if ( className.indexOf(PLUGIN_ID+".MemSample") != -1 //$NON-NLS-1$
|| className.indexOf("com.nokia.carbide.pi.memory.MemSample") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.model.MemSample") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.memTracePlugin.MemSample") != -1) //$NON-NLS-1$
{
return MemSample.class;
}
- else if ( className.indexOf("[Lcom.nokia.carbide.cpp.pi.memory.MemThread") != -1 //$NON-NLS-1$
+ else if ( className.indexOf("[L"+PLUGIN_ID+".MemThread") != -1 //$NON-NLS-1$
|| className.indexOf("[Lcom.nokia.carbide.pi.memory.MemThread") != -1 //$NON-NLS-1$
|| className.indexOf("[Lfi.vtt.bappea.model.MemThread;") != -1 //$NON-NLS-1$
|| className.indexOf("[Lfi.vtt.bappea.memTracePlugin.MemThread") != -1) //$NON-NLS-1$
{
return MemThread[].class;
}
- else if ( className.indexOf("com.nokia.carbide.cpp.pi.memory.MemThread") != -1 //$NON-NLS-1$
+ else if ( className.indexOf(PLUGIN_ID+".MemThread") != -1 //$NON-NLS-1$
|| className.indexOf("com.nokia.carbide.pi.memory.MemThread") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.model.MemThread") != -1 //$NON-NLS-1$
|| className.indexOf("fi.vtt.bappea.memTracePlugin.MemThread") != -1) //$NON-NLS-1$
@@ -174,7 +176,7 @@
memTrace.setVersion(versionNumber);
} */
- NpiInstanceRepository.getInstance().activeUidAddTrace("com.nokia.carbide.cpp.pi.memory", trace); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidAddTrace(PLUGIN_ID, trace); //$NON-NLS-1$
memTrace.gatherDrawData();
@@ -215,7 +217,7 @@
//profilerVersion = memParser.getProfilerVersion();
return traceData;
- } catch (Exception e)
+ } catch (IOException e)
{
e.printStackTrace();
throw e;
@@ -223,7 +225,7 @@
}
public MenuManager getViewOptionManager() {
- if (NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.memory") == null) //$NON-NLS-1$
+ if (NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID) == null) //$NON-NLS-1$
return null; // no trace, so no MenuManager
boolean showChunk = true;
@@ -231,22 +233,22 @@
// if there is a showChunk value associated with the current Analyser tab, then use it
Object obj;
- obj = NpiInstanceRepository.getInstance().activeUidGetPersistState("com.nokia.carbide.cpp.pi.memory.showChunk"); //$NON-NLS-1$
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(PLUGIN_ID+".showChunk"); //$NON-NLS-1$
if ((obj != null) && (obj instanceof Boolean))
// retrieve the current value
showChunk = (Boolean)obj;
else
// set the initial value
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showChunk", showChunk); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showChunk", showChunk); //$NON-NLS-1$
// if there is a showHeapStack value associated with the current Analyser tab, then use it
- obj = NpiInstanceRepository.getInstance().activeUidGetPersistState("com.nokia.carbide.cpp.pi.memory.showHeapStack"); //$NON-NLS-1$
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(PLUGIN_ID+".showHeapStack"); //$NON-NLS-1$
if ((obj != null) && (obj instanceof Boolean))
// retrieve the current value
showHeapStack = (Boolean)obj;
else
// set the initial value
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showHeapStack", showHeapStack); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showHeapStack", showHeapStack); //$NON-NLS-1$
Action action;
@@ -298,13 +300,13 @@
boolean rescale = false;
// if there is a rescale value associated with the current Analyser tab, then use it
- obj = NpiInstanceRepository.getInstance().activeUidGetPersistState("com.nokia.carbide.cpp.pi.memory.rescale"); //$NON-NLS-1$
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(PLUGIN_ID+".rescale"); //$NON-NLS-1$
if ((obj != null) && (obj instanceof Boolean))
// retrieve the current value
rescale = (Boolean)obj;
else
// set the initial value
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.rescale", rescale); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".rescale", rescale); //$NON-NLS-1$
action = new Action(Messages.getString("MemoryPlugin.dynamicRescale"), Action.AS_CHECK_BOX) { //$NON-NLS-1$
public void run() {
@@ -321,13 +323,13 @@
boolean showMemoryUsageLine = true;
// if there is a show memory usage value associated with the current Analyser tab, then use it
- obj = NpiInstanceRepository.getInstance().activeUidGetPersistState("com.nokia.carbide.cpp.pi.memory.showMemoryUsage"); //$NON-NLS-1$
+ obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(PLUGIN_ID+".showMemoryUsage"); //$NON-NLS-1$
if ((obj != null) && (obj instanceof Boolean))
// retrieve the current value
showMemoryUsageLine = (Boolean)obj;
else
// set the initial value
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showMemoryUsage", showMemoryUsageLine); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showMemoryUsage", showMemoryUsageLine); //$NON-NLS-1$
action = new Action(Messages.getString("MemTraceGraph.showTotalMemoryUsage"), Action.AS_CHECK_BOX) { //$NON-NLS-1$
public void run() {
@@ -346,7 +348,7 @@
public void receiveEvent(String actionString, Event event) {
- MemTrace trace = (MemTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.memory"); //$NON-NLS-1$
+ MemTrace trace = (MemTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
if (trace == null)
return;
@@ -376,22 +378,22 @@
return;
if (actionString.equals("chunk_on")) { //$NON-NLS-1$
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showChunk", true); //$NON-NLS-1$
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showHeapStack", false); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showChunk", true); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showHeapStack", false); //$NON-NLS-1$
} else if (actionString.equals("heapstack_on")) { //$NON-NLS-1$
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showChunk", false); //$NON-NLS-1$
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showHeapStack", true); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showChunk", false); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showHeapStack", true); //$NON-NLS-1$
} else if (actionString.equals("chunk_heapstack_on")) { //$NON-NLS-1$
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showChunk", true); //$NON-NLS-1$
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showHeapStack", true); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showChunk", true); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showHeapStack", true); //$NON-NLS-1$
} else if (actionString.equals("rescale_on")) { //$NON-NLS-1$
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.rescale", true); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".rescale", true); //$NON-NLS-1$
} else if (actionString.equals("rescale_off")) { //$NON-NLS-1$
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.rescale", false); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".rescale", false); //$NON-NLS-1$
} else if (actionString.equals("memory_usage_line_on")) { //$NON-NLS-1$
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showMemoryUsage", true); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showMemoryUsage", true); //$NON-NLS-1$
} else if (actionString.equals("memory_usage_line_off")) { //$NON-NLS-1$
- NpiInstanceRepository.getInstance().activeUidSetPersistState("com.nokia.carbide.cpp.pi.memory.showMemoryUsage", false); //$NON-NLS-1$
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(PLUGIN_ID+".showMemoryUsage", false); //$NON-NLS-1$
}else {
return;
}
@@ -411,7 +413,7 @@
// }
public GenericTraceGraph getTraceGraph(int graphIndex) {
- MemTrace trace = (MemTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.memory"); //$NON-NLS-1$
+ MemTrace trace = (MemTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
if (trace != null)
return trace.getTraceGraph(graphIndex);
@@ -420,7 +422,7 @@
}
public Integer getLastSample(int graphIndex) {
- MemTrace trace = (MemTrace)NpiInstanceRepository.getInstance().activeUidGetTrace("com.nokia.carbide.cpp.pi.memory"); //$NON-NLS-1$
+ MemTrace trace = (MemTrace)NpiInstanceRepository.getInstance().activeUidGetTrace(PLUGIN_ID); //$NON-NLS-1$
if (trace != null)
return Integer.valueOf(trace.getLastSampleNumber());
@@ -511,4 +513,20 @@
public void setPageIndex(int index, int pageIndex) {
return;
}
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -21,7 +21,7 @@
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.memory.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/ProfiledLibraryEvent.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.memory/src/com/nokia/carbide/cpp/pi/memory/ProfiledLibraryEvent.java Wed Jun 23 15:05:09 2010 +0300
@@ -99,6 +99,11 @@
}
public MemThread getLastMemThread(){
+ if(memSamples.isEmpty()){
+ MemThread mt = new MemThread(-1, "","");
+ mt.maxMemoryItem = new MaxMemoryItem();
+ return mt;
+ }
return memSamples.get(memSamples.lastKey()).thread;
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.peccommon/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.peccommon/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Counters Common PI Plugin
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.peccommon;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.peccommon.PecCommonPlugin
Bundle-Vendor: Nokia
Require-Bundle: org.eclipse.ui,
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.peccommon/src/com/nokia/carbide/cpp/pi/peccommon/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.peccommon/src/com/nokia/carbide/cpp/pi/peccommon/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
import org.eclipse.osgi.util.NLS;
-public class Messages extends NLS {
+public final class Messages extends NLS {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.peccommon.messages"; //$NON-NLS-1$
public static String PecCommonLegend_0;
public static String PecCommonLegend_1;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.peccommon/src/com/nokia/carbide/cpp/pi/peccommon/PecCommonTrace.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.peccommon/src/com/nokia/carbide/cpp/pi/peccommon/PecCommonTrace.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,17 +17,20 @@
package com.nokia.carbide.cpp.pi.peccommon;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
import java.util.Vector;
import com.nokia.carbide.cpp.internal.pi.model.GenericSample;
import com.nokia.carbide.cpp.internal.pi.model.GenericSampledTrace;
+import com.nokia.carbide.cpp.internal.pi.model.ICPUScale;
/**
* The model class for Performance Counter traces. This manages the data
* for the IPC trace graphs, and is responsible for creating the graphs.
*/
-public class PecCommonTrace extends GenericSampledTrace {
+public class PecCommonTrace extends GenericSampledTrace implements ICPUScale{
private static final long serialVersionUID = 4425739452429422333L;
private int samplingInterval;
@@ -44,6 +47,8 @@
private double selectionStart;
private double selectionEnd;
private transient boolean needsRecalc;
+
+ private int cpuClockRate;
private transient PecCommonLegendElement[] legendElements;
@@ -186,4 +191,85 @@
}
return les;
}
-}
+
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.model.ICPUScale#calculateScale(int)
+ */
+ public float calculateScale(int sampleSynchTime) {
+ if (cpuClockRate <= 0) {
+ return 1;
+ }
+ GenericSample genericSample = null;
+ if((samples.size() - 1) >= sampleSynchTime){
+ genericSample = samples.get(sampleSynchTime);
+ }else{
+ genericSample = samples.lastElement();
+ }
+ if (genericSample instanceof PecCommonSample) {
+ int[] values = ((PecCommonSample) genericSample).values;
+ return (float) values[4] / cpuClockRate;
+ }
+ return 1;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.model.ICPUScale#calculateScale(int, int)
+ */
+ public float calculateScale(int startSynchTime, int endSynchTime) {
+ if (cpuClockRate <= 0) {
+ return 1;
+ }
+ if(startSynchTime > endSynchTime){
+ return 1;
+ }
+ List<Float> sampleList = new ArrayList<Float>();
+ while(startSynchTime <= endSynchTime ){
+ GenericSample genericSample = null;
+ if((samples.size() - 1) >= endSynchTime){
+ genericSample = samples.get(endSynchTime);
+ }else{
+ genericSample = samples.lastElement();
+ }
+ if (genericSample instanceof PecCommonSample) {
+ int[] values = ((PecCommonSample) genericSample).values;
+ float cpuSampleClockRate = (float) values[4] / cpuClockRate;
+ sampleList.add(cpuSampleClockRate);
+ }
+ startSynchTime += 100;
+ }
+ if(sampleList.size() > 0){
+ float sum = 0;
+ for(float value : sampleList){
+ sum += value;
+ }
+ return sum / sampleList.size();
+ }else{
+ return 1;
+ }
+ }
+
+ /**
+ * @param cpuClockRate the cpuClockRate to set
+ */
+ public void setCpuClockRate(int cpuClockRate) {
+ this.cpuClockRate = cpuClockRate;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.model.ICPUScale#isCpuScaleSupported()
+ */
+ public boolean isCpuScaleSupported(){
+ if(cpuClockRate > 0){
+ return true;
+ }else{
+ return false;
+ }
+ }
+
+
+}
\ No newline at end of file
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.peccommon/src/com/nokia/carbide/cpp/pi/peccommon/PecCommonTraceGraph.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.peccommon/src/com/nokia/carbide/cpp/pi/peccommon/PecCommonTraceGraph.java Wed Jun 23 15:05:09 2010 +0300
@@ -93,6 +93,9 @@
/** GUI manager has knowledge off all IpcTraceGraphs; can broadcast some of the events */
private PecCommonGuiManager guiManager;
+
+ private int lastEdgeX;
+ private int paintCount;
/**
* Constructor
@@ -210,6 +213,15 @@
if (sectionHeight > 60f){ //only draw the label if the section has a decent height
int edgeX = ((Viewport) panel.getParent()).getViewLocation().x;
+ if (lastEdgeX != edgeX && paintCount < 1 && guiManager != null) {
+ paintCount++;
+ guiManager.selectionAreaChanged(PIPageEditor
+ .currentPageEditor().getStartTime(), PIPageEditor
+ .currentPageEditor().getEndTime());
+ } else {
+ paintCount = 0;
+ }
+ lastEdgeX = edgeX;
for (int i = 0; i < drawSeries.size(); i++) {
int seriesIdx = drawSeries.get(i);
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Counters PI Plugin
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.perfcounters;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.perfcounters.PecPlugin
Bundle-Vendor: Nokia
Require-Bundle: org.eclipse.ui,
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/plugin.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/plugin.xml Wed Jun 23 15:05:09 2010 +0300
@@ -8,4 +8,15 @@
</plugin>
</extension>
+ <extension
+ point="org.eclipse.core.runtime.adapters">
+ <factory
+ adaptableType="com.nokia.carbide.cpp.internal.pi.model.ICPUScaleAdapter"
+ class="com.nokia.carbide.cpp.pi.internal.perfcounters.PecTraceAdapterFactory">
+ <adapter
+ type="com.nokia.carbide.cpp.internal.pi.model.ICPUScale">
+ </adapter>
+ </factory>
+ </extension>
+
</plugin>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/internal/perfcounters/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/internal/perfcounters/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,7 +17,7 @@
package com.nokia.carbide.cpp.pi.internal.perfcounters;
import org.eclipse.osgi.util.NLS;
-public class Messages extends NLS {
+public final class Messages extends NLS {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.internal.perfcounters.messages"; //$NON-NLS-1$
public static String PecLegend_6;
public static String PecLegend_7;
@@ -43,6 +43,7 @@
public static String PecTraceParser_20;
public static String PecTraceParser_21;
public static String PecTraceParser_22;
+ public static String PecTraceParser_23;
public static String PecTraceParser_3;
public static String PecTraceParser_4;
public static String PecTraceParser_5;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/internal/perfcounters/PecTraceAdapterFactory.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.carbide.cpp.pi.internal.perfcounters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+
+import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
+import com.nokia.carbide.cpp.internal.pi.model.ICPUScale;
+import com.nokia.carbide.cpp.internal.pi.model.ParsedTraceData;
+import com.nokia.carbide.cpp.internal.pi.model.TraceDataRepository;
+import com.nokia.carbide.cpp.pi.peccommon.PecCommonTrace;
+
+public class PecTraceAdapterFactory implements IAdapterFactory {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+ */
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ int uid = NpiInstanceRepository.getInstance().activeUid();
+ ParsedTraceData ptd = TraceDataRepository.getInstance().getTrace(uid, PecTrace.class); //$NON-NLS-1$
+ if(ptd != null){
+ PecCommonTrace pecTrace = (PecCommonTrace) ptd.traceData;
+ return pecTrace;
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+ */
+ @SuppressWarnings("unchecked")
+ public Class[] getAdapterList() {
+ return new Class[] {ICPUScale.class};
+ }
+
+}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/internal/perfcounters/PecTraceParser.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/internal/perfcounters/PecTraceParser.java Wed Jun 23 15:05:09 2010 +0300
@@ -42,6 +42,8 @@
private static final int INSTRUCTIONS_EXECUTED = 0x7;
private static final int CPU_CLOCK_TICK_DIV64 = 0xFFFF;
private static final int DUMMY_MIPS_ID = -1;
+ private static final int DUMMY_CPU_CLOCK_ID = -2;
+ private static final String DATA_FORMAT_VERSION_OLD = "Bappea_V1.24_PEC";
private boolean debug = false;
@@ -53,7 +55,7 @@
/** produce MIPS graph data */
protected boolean mipsEnabled;
- /** the processor speed to use for MIPS graph calculations */
+ /** the processor speed to use for MIPS graph calculations. Updated from data samples if data is available */
protected int processorSpeed;
/**
@@ -65,31 +67,32 @@
this.allowUserInteraction = allowUserInteraction;
}
- private static final Map<Integer, String> eventTypeTable = new HashMap<Integer, String>();
+ private static final Map<Integer, String> EVENT_TYPE_TABLE = new HashMap<Integer, String>();
static {
- eventTypeTable.put(0x0,Messages.PecTraceParser_0);
- eventTypeTable.put(0x1,Messages.PecTraceParser_1);
- eventTypeTable.put(0x2,Messages.PecTraceParser_2);
- eventTypeTable.put(0x3,Messages.PecTraceParser_3);
- eventTypeTable.put(0x4, Messages.PecTraceParser_4);
- eventTypeTable.put(0x5, Messages.PecTraceParser_5);
- eventTypeTable.put(0x6, Messages.PecTraceParser_6);
- eventTypeTable.put(INSTRUCTIONS_EXECUTED, Messages.PecTraceParser_7);
- eventTypeTable.put(0x9, Messages.PecTraceParser_8);
- eventTypeTable.put(0xA, Messages.PecTraceParser_9);
- eventTypeTable.put(0xB, Messages.PecTraceParser_10);
- eventTypeTable.put(0xC, Messages.PecTraceParser_11);
- eventTypeTable.put(0xD, Messages.PecTraceParser_12);
- eventTypeTable.put(0xF, Messages.PecTraceParser_13);
- eventTypeTable.put(0x10, Messages.PecTraceParser_14);
- eventTypeTable.put(0x11, Messages.PecTraceParser_15);
- eventTypeTable.put(0x12, Messages.PecTraceParser_16);
- eventTypeTable.put(0x20, Messages.PecTraceParser_17);
- eventTypeTable.put(0x21, Messages.PecTraceParser_18);
- eventTypeTable.put(0x22, Messages.PecTraceParser_19);
- eventTypeTable.put(0xFF, Messages.PecTraceParser_20);
- eventTypeTable.put(CPU_CLOCK_TICK_DIV64, Messages.PecTraceParser_21);
- eventTypeTable.put(DUMMY_MIPS_ID, PecTrace.MIPS_NAME);
+ EVENT_TYPE_TABLE.put(0x0,Messages.PecTraceParser_0);
+ EVENT_TYPE_TABLE.put(0x1,Messages.PecTraceParser_1);
+ EVENT_TYPE_TABLE.put(0x2,Messages.PecTraceParser_2);
+ EVENT_TYPE_TABLE.put(0x3,Messages.PecTraceParser_3);
+ EVENT_TYPE_TABLE.put(0x4, Messages.PecTraceParser_4);
+ EVENT_TYPE_TABLE.put(0x5, Messages.PecTraceParser_5);
+ EVENT_TYPE_TABLE.put(0x6, Messages.PecTraceParser_6);
+ EVENT_TYPE_TABLE.put(INSTRUCTIONS_EXECUTED, Messages.PecTraceParser_7);
+ EVENT_TYPE_TABLE.put(0x9, Messages.PecTraceParser_8);
+ EVENT_TYPE_TABLE.put(0xA, Messages.PecTraceParser_9);
+ EVENT_TYPE_TABLE.put(0xB, Messages.PecTraceParser_10);
+ EVENT_TYPE_TABLE.put(0xC, Messages.PecTraceParser_11);
+ EVENT_TYPE_TABLE.put(0xD, Messages.PecTraceParser_12);
+ EVENT_TYPE_TABLE.put(0xF, Messages.PecTraceParser_13);
+ EVENT_TYPE_TABLE.put(0x10, Messages.PecTraceParser_14);
+ EVENT_TYPE_TABLE.put(0x11, Messages.PecTraceParser_15);
+ EVENT_TYPE_TABLE.put(0x12, Messages.PecTraceParser_16);
+ EVENT_TYPE_TABLE.put(0x20, Messages.PecTraceParser_17);
+ EVENT_TYPE_TABLE.put(0x21, Messages.PecTraceParser_18);
+ EVENT_TYPE_TABLE.put(0x22, Messages.PecTraceParser_19);
+ EVENT_TYPE_TABLE.put(0xFF, Messages.PecTraceParser_20);
+ EVENT_TYPE_TABLE.put(CPU_CLOCK_TICK_DIV64, Messages.PecTraceParser_21);
+ EVENT_TYPE_TABLE.put(DUMMY_MIPS_ID, PecTrace.MIPS_NAME);
+ EVENT_TYPE_TABLE.put(DUMMY_CPU_CLOCK_ID, Messages.PecTraceParser_23);
}
/* (non-Javadoc)
@@ -123,27 +126,52 @@
int firstData = dis.readUnsignedByte();
int secondData = dis.readUnsignedByte();
int thirdData = CPU_CLOCK_TICK_DIV64;
-
- if (allowUserInteraction && (firstData == INSTRUCTIONS_EXECUTED || secondData == INSTRUCTIONS_EXECUTED)){
- Display.getDefault().syncExec( new Runnable() {
+
+ if (this.traceVersion.equals(DATA_FORMAT_VERSION_OLD)) {
+ if (allowUserInteraction && (firstData == INSTRUCTIONS_EXECUTED || secondData == INSTRUCTIONS_EXECUTED)){
+ Display.getDefault().syncExec( new Runnable() {
- public void run () {
- // in future, if we don't want to have a dialog in the core parser class
- // we could call into an interface which ProcessorSpeedInputDialog would have to implement
- ProcessorSpeedInputDialog dialog = new ProcessorSpeedInputDialog(
- PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getShell());
- if (dialog.open() == Window.OK){
- processorSpeed = dialog.getIntValue();
- mipsEnabled = true;
+ public void run () {
+ // in future, if we don't want to have a dialog in the core parser class
+ // we could call into an interface which ProcessorSpeedInputDialog would have to implement
+ ProcessorSpeedInputDialog dialog = new ProcessorSpeedInputDialog(
+ PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell());
+ if (dialog.open() == Window.OK){
+ processorSpeed = dialog.getIntValue();
+ mipsEnabled = true;
+ }
}
- }
- });
-
-
+ });
+ }
}
+
+ // >=Bappea_V1.25_PEC
+ else {
+ if (firstData == INSTRUCTIONS_EXECUTED || secondData == INSTRUCTIONS_EXECUTED) {
+ mipsEnabled = true;
+ }
- Integer[] valueTypeVector = new Integer[mipsEnabled ? 4 : 3];
+ long cpuClockRate = readCpuClockRate(dis);
+ if(cpuClockRate > 0){
+ // Hz => MHz
+ trace.setCpuClockRate((int) cpuClockRate / 1000000);
+ }
+
+ }
+
+ int graphCount = 0;
+
+ if (this.traceVersion.equals(DATA_FORMAT_VERSION_OLD)) {
+ graphCount = 4;
+ }
+ // >=Bappea_V1.25_PEC
+ else {
+ graphCount = 5;
+ }
+
+ Integer[] valueTypeVector = new Integer[mipsEnabled ? graphCount : 3];
+
valueTypeVector[0] = Integer.valueOf(firstData);
valueTypeVector[1] = Integer.valueOf(secondData);
// this type is always the cpu clock tick div 64
@@ -151,6 +179,11 @@
if (mipsEnabled){
valueTypeVector[3] = DUMMY_MIPS_ID;
+ // >=Bappea_V1.25_PEC
+ if (!this.traceVersion.equals(DATA_FORMAT_VERSION_OLD))
+ {
+ valueTypeVector[4] = DUMMY_CPU_CLOCK_ID;
+ }
}
trace.setValueTypes(this.parseValueTypes(valueTypeVector));
@@ -171,65 +204,131 @@
private PecSample readSample(DataInputStream dis,PecSample prevSample) throws IOException
{
- int headerByte = (dis.readByte() << 24) >>> 24;
+ int headerByte = 0;
+ int negBitOffset = 0;
+ int sampleBitOffset = 0;
+
+ if (this.traceVersion.equals(DATA_FORMAT_VERSION_OLD)) {
+ headerByte = (dis.readByte() << 24) >>> 24;
+ }
+ // >=Bappea_V1.25_PEC
+ else {
+ int headerByte1 = (dis.readByte() << 24) >>> 24;
+ int headerByte2 = (dis.readByte() << 24) >>> 24;
+ headerByte = ((headerByte1) | (headerByte2) << 8);
+ negBitOffset = 1;
+ sampleBitOffset = 2;
+ }
+
int neg0 = 0;
int neg1 = 0;
int neg2 = 0;
+ int neg3 = 0;
int prev0 = 0;
int prev1 = 0;
int prev2 = 0;
+ int prev3 = 0;
if(prevSample != null)
{
prev0 = prevSample.values[0];
prev1 = prevSample.values[1];
prev2 = prevSample.values[2]/64;
+ prev3 = processorSpeed;
}
if(debug) if(this.time > 7820 && this.time < 7830) System.out.println("header: "+Long.toHexString(headerByte)+" = "+Integer.toBinaryString(headerByte)); //$NON-NLS-1$//$NON-NLS-2$
- if( ((headerByte >>> 7)&1) != 0)
+ if( ((headerByte >>> 7 + negBitOffset + sampleBitOffset)&1) != 0)
{
neg0 = 1;
}
- if( ((headerByte >>> 6)&1) != 0)
+ if( ((headerByte >>> 6 + negBitOffset + sampleBitOffset)&1) != 0)
{
neg1 = 1;
}
- if( ((headerByte >>> 5)&1) != 0)
+ if( ((headerByte >>> 5 + negBitOffset + sampleBitOffset)&1) != 0)
{
neg2 = 1;
}
- int len0 = (((headerByte >> 3) << 30) >>> 30)+1;
- int len1 = (((headerByte >> 1) << 30) >>> 30)+1;
- int len2 = ((((headerByte) << 31) >>> 31)+1)*2;
+ // >=Bappea_V1.25_PEC
+ if(!this.traceVersion.equals(DATA_FORMAT_VERSION_OLD) && ((headerByte >>> 7)&1) != 0) {
+ neg3 = 1;
+ }
+
+ int len0 = (((headerByte >> 3 + sampleBitOffset) << 30) >>> 30)+1;
+ int len1 = (((headerByte >> 1 + sampleBitOffset) << 30) >>> 30)+1;
+ int len2 = ((((headerByte >> sampleBitOffset) << 31) >>> 31)+1)*2;
+ int len3 = -1;
+ // >=Bappea_V1.25_PEC
+ if(!this.traceVersion.equals(DATA_FORMAT_VERSION_OLD)) {
+ len3 = ((((headerByte) << 30) >>> 30)+1);
+ }
- if(debug) if(this.time > 7820 && this.time < 7830) System.out.println("T:"+this.time+" len0:"+len0+" len1:"+len1+" len2:"+len2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- if(debug) if(this.time > 7900 && this.time < 7900) System.out.println("H: "+Integer.toBinaryString(headerByte)+" N0:"+neg0+" N1:"+neg1+" N2:"+neg2); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$
+ if(debug) {
+ if(!this.traceVersion.equals(DATA_FORMAT_VERSION_OLD)) {
+ if(debug) if(this.time > 7820 && this.time < 7830) System.out.println("T:"+this.time+" len0:"+len0+" len1:"+len1+" len2:"+len2+" len3:"+len3); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ if(debug) if(this.time > 7900 && this.time < 7900) System.out.println("H: "+Integer.toBinaryString(headerByte)+" N0:"+neg0+" N1:"+neg1+" N2:"+neg2+" N3:"+neg3); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+
+ } else {
+ if(debug) if(this.time > 7820 && this.time < 7830) System.out.println("T:"+this.time+" len0:"+len0+" len1:"+len1+" len2:"+len2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ if(debug) if(this.time > 7900 && this.time < 7900) System.out.println("H: "+Integer.toBinaryString(headerByte)+" N0:"+neg0+" N1:"+neg1+" N2:"+neg2); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$
+ }
+ }
long val0 = readVal(neg0,len0,dis);
long val1 = readVal(neg1,len1,dis);
long val2 = readVal(neg2,len2,dis);
+ long val3 = -1;
- if(debug) if(this.time > 7820 && this.time < 7900) System.out.println("READ T:"+this.time+" V0:"+Long.toHexString(val0)+" V1:"+Long.toHexString(val1)+" V2:"+Long.toHexString(val2)); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$
+ // >=Bappea_V1.25_PEC
+ if(!this.traceVersion.equals(DATA_FORMAT_VERSION_OLD)) {
+ if (mipsEnabled) {
+ val3 = readVal(neg3,len3,dis);
+ }
+ }
+
+ if(debug) {
+ if(!this.traceVersion.equals(DATA_FORMAT_VERSION_OLD)) {
+ if(this.time > 7820 && this.time < 7900) System.out.println("READ T:"+this.time+" V0:"+Long.toHexString(val0)+" V1:"+Long.toHexString(val1)+" V2:"+Long.toHexString(val2)+" V3:"+Long.toHexString(val3)); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ } else {
+ if(this.time > 7820 && this.time < 7900) System.out.println("READ T:"+this.time+" V0:"+Long.toHexString(val0)+" V1:"+Long.toHexString(val1)+" V2:"+Long.toHexString(val2)); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$
+ }
+ }
+
val0 = prev0-val0;
val1 = prev1-val1;
val2 = prev2-val2;
+ // >=Bappea_V1.25_PEC
+ if(!this.traceVersion.equals(DATA_FORMAT_VERSION_OLD)) {
+ val3 = prev3-val3;
+ processorSpeed = (int)val3;
+ }
+
int[] values;
- if (mipsEnabled){
+ if (!this.traceVersion.equals(DATA_FORMAT_VERSION_OLD) && mipsEnabled) {
+ values = new int[]{(int)val0,(int)val1,((int)val2)*64, (int)((val3 / 1000000) * val1 / (val2*64)), ((int)(val3 / 1000000))};
+ } else if (mipsEnabled) {
values = new int[]{(int)val0,(int)val1,((int)val2)*64, (int)(processorSpeed * val1 / (val2*64))};
} else {
- values = new int[]{(int)val0,(int)val1,((int)val2)*64};
+ values = new int[]{(int)val0,(int)val1,((int)val2)*64};
}
- PecSample ps = new PecSample(values, this.time);
+ PecSample ps = new PecSample(values, this.time);
- if(debug) if(this.time > 7820 && this.time < 7900) System.out.println("T:"+this.time+" V0:"+Long.toHexString(val0)+" V1:"+Long.toHexString(val1)+" V2:"+Long.toHexString(val2)); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- if(debug) if(this.time > 7820 && this.time < 7900) System.out.println("T:"+this.time+" "+val0+" "+val1+" "+val2); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
+ if (debug) {
+ if(!this.traceVersion.equals(DATA_FORMAT_VERSION_OLD)) {
+ if(this.time > 7820 && this.time < 7900) System.out.println("T:"+this.time+" V0:"+Long.toHexString(val0)+" V1:"+Long.toHexString(val1)+" V2:"+Long.toHexString(val2)+" V3:"+Long.toHexString(val3)); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ if(this.time > 7820 && this.time < 7900) System.out.println("T:"+this.time+" "+val0+" "+val1+" "+val2+" "+val3); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4//$NON-NLS-5$$
+ } else {
+ if(this.time > 7820 && this.time < 7900) System.out.println("T:"+this.time+" V0:"+Long.toHexString(val0)+" V1:"+Long.toHexString(val1)+" V2:"+Long.toHexString(val2)); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ if(this.time > 7820 && this.time < 7900) System.out.println("T:"+this.time+" "+val0+" "+val1+" "+val2); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
+ }
+ }
this.time++;
return ps;
@@ -277,7 +376,7 @@
}
private String convertValueType(int value) {
- String s = eventTypeTable.get(Integer.valueOf(value));
+ String s = EVENT_TYPE_TABLE.get(Integer.valueOf(value));
if (s == null){
s = String.format(
Messages.PecTraceParser_22,
@@ -286,5 +385,12 @@
return s;
}
-
+ private long readCpuClockRate(DataInputStream dis) throws IOException
+ {
+ long result = dis.readUnsignedByte();
+ result += dis.readUnsignedByte() << 8;
+ result += dis.readUnsignedByte() << 16;
+ result += dis.readUnsignedByte() << 24;
+ return result;
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/internal/perfcounters/messages.properties Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/internal/perfcounters/messages.properties Wed Jun 23 15:05:09 2010 +0300
@@ -22,6 +22,7 @@
PecTraceParser_20=[Precise CPU Cycles] / [1 sampled ms]
PecTraceParser_21=[CPU Cycles (64 cycle accuracy)] / [1 sampled ms]
PecTraceParser_22=Value %d not identified as Performance counter event\!
+PecTraceParser_23=[CPU clock rate (MHz)]
PecTraceParser_3=[Instruction MicroTLB miss] / [1 sampled ms]
PecTraceParser_4=[Data MicroTLB miss] / [1 sampled ms]
PecTraceParser_5=[Branch instruction executed] / [1 sampled ms]
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/internal/perfcounters/ui/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/internal/perfcounters/ui/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
import org.eclipse.osgi.util.NLS;
-public class Messages extends NLS {
+public final class Messages extends NLS {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.internal.perfcounters.ui.messages"; //$NON-NLS-1$
public static String ProcessorSpeedInputDialog_0;
public static String ProcessorSpeedInputDialog_1;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/perfcounters/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/perfcounters/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
import org.eclipse.osgi.util.NLS;
-public class Messages extends NLS {
+public final class Messages extends NLS {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.perfcounters.messages"; //$NON-NLS-1$
public static String PecPlugin_0;
public static String PecPlugin_1;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/perfcounters/PecPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/perfcounters/PecPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -56,7 +56,7 @@
// The shared instance
private static PecPlugin plugin;
- private static final Map<Integer, PecGuiManager> guiManagerMap = new HashMap<Integer, PecGuiManager>();
+ private static final Map<Integer, PecGuiManager> GUI_MANAGER_MAP = new HashMap<Integer, PecGuiManager>();
/**
* The constructor
@@ -122,7 +122,7 @@
//create the GUI class which manages the graphs
int uid = NpiInstanceRepository.getInstance().activeUid();
- guiManagerMap.put(uid, new PecGuiManager(uid, parsedTrace, GRAPH_COUNT, Messages.PecPlugin_0));
+ GUI_MANAGER_MAP.put(uid, new PecGuiManager(uid, parsedTrace, GRAPH_COUNT, Messages.PecPlugin_0));
}
/* (non-Javadoc)
@@ -245,7 +245,7 @@
*/
public IGenericTraceGraph getTraceGraph(int graphIndex) {
int uid = NpiInstanceRepository.getInstance().activeUid();
- PecGuiManager guiManager = guiManagerMap.get(uid);
+ PecGuiManager guiManager = GUI_MANAGER_MAP.get(uid);
if (guiManager != null){
return guiManager.getTraceGraph(graphIndex, HELP_CONTEXT_ID_MAIN_PAGE);
@@ -294,7 +294,7 @@
// Do any cleanup work here when the editor closes
int uid = NpiInstanceRepository.getInstance().activeUid();
- guiManagerMap.remove(uid);
+ GUI_MANAGER_MAP.remove(uid);
}
/* (non-Javadoc)
@@ -315,5 +315,20 @@
}
return null;
}
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Power Usage
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.power;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.power.PowerPlugin
Bundle-Vendor: Nokia
Bundle-Localization: plugin
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/internal/pi/power/actions/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/internal/pi/power/actions/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -21,7 +21,7 @@
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.power.actions.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/internal/pi/power/actions/PowerStatisticsDialog.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/internal/pi/power/actions/PowerStatisticsDialog.java Wed Jun 23 15:05:09 2010 +0300
@@ -264,6 +264,9 @@
PowerTraceGraph graph = trace.getPowerGraph(0, NpiInstanceRepository.getInstance().activeUid()); // since graphs are in lockstep, any will do
int index = graph.timeIndex(selStart);
+ if(index == -1){
+ return;
+ }
// count time before the first sample as a bunch of zeros
if (selStart < trace.getFirstSampleNumber()) {
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -21,7 +21,7 @@
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.power.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PowerPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PowerPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -362,4 +362,20 @@
public void setPageIndex(int index, int pageIndex) {
return;
}
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PowerTraceGraph.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PowerTraceGraph.java Wed Jun 23 15:05:09 2010 +0300
@@ -21,9 +21,14 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DecimalFormat;
+import java.text.MessageFormat;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
import java.util.Vector;
+import java.util.Map.Entry;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.FigureCanvas;
@@ -98,6 +103,11 @@
private double minAmps = Integer.MAX_VALUE;
private double maxPower = 0.0;
private boolean mSelecting = false;
+
+ private static final int EVENT_TOPOFLINE = 50;
+ private static final int EVENT_BOTTOMOFLINE = 30;
+ private static final int EVENT_RECTWIDTH = 5;
+ private static final int EVENT_RECTHEIGHT = 5;
// used when determining when to draw the text over the power bar.
private int leftBorder = 0;
@@ -111,8 +121,9 @@
private int uid;
- protected static int SAMPLES_AT_ONE_TIME = 1000;
+ protected final static int SAMPLES_AT_ONE_TIME = 1000;
protected int stringTime;
+ private boolean backlightEnabled;
// class to pass sample data to the save wizard
@@ -152,7 +163,11 @@
String returnString = null;
if (this.stringTime == startTime) {
- returnString = Messages.getString("PowerTraceGraph.saveSamplesHeading"); //$NON-NLS-1$
+ if(backlightEnabled){
+ returnString = Messages.getString("PowerTraceGraph.saveBacklightSamplesHeading"); //$NON-NLS-1$
+ }else{
+ returnString = Messages.getString("PowerTraceGraph.saveSamplesHeading"); //$NON-NLS-1$
+ }
}
this.stringTime++;
@@ -166,6 +181,7 @@
double oldCurrent = -1;
double oldVoltage = -1;
double oldCapacity = -1;
+ int oldBacklight = -1;
String string = ""; //$NON-NLS-1$
if (this.trace.isComplete()) {
@@ -176,12 +192,18 @@
double current = sample.current;
double voltage = sample.voltage;
double capacity = sample.capacity;
+ int backlight = sample.backlight;
- if ((oldCurrent != current) || (oldVoltage != voltage) || (oldCapacity != capacity)) {
- string = Messages.getString("PowerTraceGraph.comma") + (int) current + Messages.getString("PowerTraceGraph.comma") + (int) voltage + Messages.getString("PowerTraceGraph.comma") + (int) capacity + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ if ((oldCurrent != current) || (oldVoltage != voltage) || (oldCapacity != capacity)|| (oldBacklight != backlight)) {
+ if(backlightEnabled){
+ string = Messages.getString("PowerTraceGraph.comma") + (int) current + Messages.getString("PowerTraceGraph.comma") + (int) voltage + Messages.getString("PowerTraceGraph.comma") + (int) capacity + Messages.getString("PowerTraceGraph.comma") + PwrSample.getBacklightInformation(backlight) +"\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ }else{
+ string = Messages.getString("PowerTraceGraph.comma") + (int) current + Messages.getString("PowerTraceGraph.comma") + (int) voltage + Messages.getString("PowerTraceGraph.comma") + (int) capacity + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
oldCurrent = current;
oldVoltage = voltage;
oldCapacity = capacity;
+ oldBacklight = backlight;
}
returnString += sample.sampleSynchTime + string;
@@ -209,8 +231,14 @@
double current = sample.current;
double voltage = sample.voltage;
double capacity = sample.capacity;
+ int backlight = sample.backlight;
- returnString += sample.sampleSynchTime + Messages.getString("PowerTraceGraph.comma") + (int) current + Messages.getString("PowerTraceGraph.comma") + (int) voltage + Messages.getString("PowerTraceGraph.comma") + (int) capacity + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ if(backlightEnabled){
+ returnString += sample.sampleSynchTime + Messages.getString("PowerTraceGraph.comma") + (int) current + Messages.getString("PowerTraceGraph.comma") + (int) voltage + Messages.getString("PowerTraceGraph.comma") + (int) capacity + Messages.getString("PowerTraceGraph.comma") + PwrSample.getBacklightInformation(backlight) +"\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ }else{
+ returnString += sample.sampleSynchTime + Messages.getString("PowerTraceGraph.comma") + (int) current + Messages.getString("PowerTraceGraph.comma") + (int) voltage + Messages.getString("PowerTraceGraph.comma") + (int) capacity + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+
count--;
}
}
@@ -271,6 +299,10 @@
this.minAmps = this.trace.getMinAmps();
this.maxPower = this.trace.getMaxPower();
}
+ backlightEnabled = trace.isBacklightEnabled();
+ if(backlightEnabled){
+ xLegendHeight = 50;
+ }
}
public int getUid() {
@@ -446,9 +478,53 @@
this.drawSelectionSection(graphics, PowerTraceGraph.xLegendHeight);
if (mShowPowerLine)
- this.drawPowerLine(graphics);
+ this.drawPowerLine(graphics);
+
+ if(backlightEnabled){
+ drawBacklightEvents(graphics);
+ }
}
+
+ private void drawBacklightEvents(Graphics graphics){
+ Map<Long, Integer> backLightChangePoints = ((PwrTrace)getTrace()).getBacklightChangePoints();
+ Set<Entry<Long, Integer>> entrySet = backLightChangePoints.entrySet();
+ Iterator<Entry<Long, Integer>> iterator = entrySet.iterator();
+ int lastXLabelEnd = -1; //the x coordinate at which the last drawn label ended
+ int height = this.getVisualSize().height;
+ String eventName = ""; //$NON-NLS-1$
+ while(iterator.hasNext()){
+ Entry<Long, Integer> entry = iterator.next();
+ double scale = this.getScale();
+ int x = (int)(entry.getKey()/scale);
+ graphics.setForegroundColor(ColorConstants.red);
+ graphics.drawLine(x, height - EVENT_TOPOFLINE, x, height - EVENT_BOTTOMOFLINE);
+ eventName = Messages.getString("PowerTraceGraph.backlightGraphItem") + PwrSample.getBacklightInformation(entry.getValue()); //$NON-NLS-1$
+
+ graphics.setFont(PIPageEditor.helvetica_8);
+
+ GC gc = new GC(PIPageEditor.currentPageEditor().getSite().getShell());
+ Point point = gc.stringExtent(eventName);
+ gc.dispose();
+
+ int xLabelStart = x - (point.x / 2);
+ if(xLabelStart < 0){
+ xLabelStart = 0;
+ }
+ if (xLabelStart > lastXLabelEnd){ //only draw label if it doesn't overlap with previous
+ graphics.setForegroundColor(ColorConstants.red);
+ graphics.drawString(eventName, xLabelStart, height - EVENT_BOTTOMOFLINE + 3 + EVENT_RECTHEIGHT);
+ lastXLabelEnd = x + (point.x / 2);
+ }
+
+ graphics.setBackgroundColor(ColorConstants.red);
+
+ graphics.drawLine(x , height - EVENT_BOTTOMOFLINE + 1, x, height - EVENT_BOTTOMOFLINE + 2);
+ graphics.fillRectangle(x - (EVENT_RECTWIDTH / 2), height - EVENT_BOTTOMOFLINE + 3,
+ EVENT_RECTWIDTH, EVENT_RECTHEIGHT);
+ }
+ }
+
public void repaint()
{
this.parentComponent.repaintComponent();
@@ -457,7 +533,7 @@
private void showPowerValueAtX(MouseEvent me)
{
if (me.y > this.getVisualSizeY() - PowerTraceGraph.xLegendHeight) {
- this.setToolTipText(null);
+ handleBacklightMouseEvents(me);
return;
}
@@ -465,7 +541,7 @@
int x = (int) (me.x * this.getScale() + 0.5);
if (x > (int) (PIPageEditor.currentPageEditor().getMaxEndTime() * 1000 + 0.0005)) {
- this.setToolTipText(null);
+ handleBacklightMouseEvents(me);
return;
}
@@ -520,7 +596,7 @@
}
public int timeIndex(int time) {
- if (time < sampleTimes[0])
+ if (sampleTimes.length <= 0 || time < sampleTimes[0])
return -1;
if (time >= sampleTimes[sampleTimes.length - 1])
@@ -963,6 +1039,9 @@
// find the first sample greater than or equal to selStart
int index = timeIndex(selStart);
+ if(index == -1){
+ return;
+ }
// count time before the first sample as a bunch of zeros
if (selStart < trace.getFirstSampleNumber()) {
@@ -1174,4 +1253,53 @@
public String getContextHelpId() {
return PowerPlugin.HELP_CONTEXT_ID_MAIN_PAGE;
}
+
+ private void handleBacklightMouseEvents(MouseEvent me) {
+ if (!backlightEnabled){
+ setToolTipText(null);
+ return;
+ }
+ long x = me.x;
+ long y = me.y;
+
+ int height = this.getVisualSize().height;
+
+ // make sure we're in the right area of the graph window
+ if ((y < height - EVENT_BOTTOMOFLINE) || (y > height - EVENT_BOTTOMOFLINE + EVENT_RECTHEIGHT + 2))
+ return;
+
+ double scale = this.getScale();
+
+ String tooltip = ""; //$NON-NLS-1$
+
+ Map<Long, Integer> backLightChangePoints = ((PwrTrace)getTrace()).getBacklightChangePoints();
+ Set<Entry<Long, Integer>> entrySet = backLightChangePoints.entrySet();
+ Iterator<Entry<Long, Integer>> iterator = entrySet.iterator();
+
+ while(iterator.hasNext()){
+ Entry<Long, Integer> entry = iterator.next();
+
+ long xSample = (long)(entry.getKey()/scale + 0.5);
+
+ // samples are in timestamp order, so stop when xSample + EVENT_RECTWIDTH is too high
+ if (x < xSample - EVENT_RECTWIDTH)
+ break;
+
+ if ((x >= xSample - EVENT_RECTWIDTH) && (x <= xSample + EVENT_RECTWIDTH))
+ {
+ String parsedName = PwrSample.getBacklightInformation(entry.getValue());
+ if (tooltip.length() > 0){
+ tooltip += Messages.getString("PowerTraceGraph.newLine"); //$NON-NLS-1$
+ }
+ tooltip += MessageFormat.format(Messages.getString("PowerTraceGraph.backlightTooltip"), parsedName,entry.getKey()/1000.0 ); //$NON-NLS-1$
+
+ }
+ }
+ if (tooltip.length() > 0) {
+ setToolTipText(tooltip);
+ }
+ else{
+ setToolTipText(null);
+ }
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PwrSample.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PwrSample.java Wed Jun 23 15:05:09 2010 +0300
@@ -29,6 +29,7 @@
public double current;
public double capacity;
public double voltage;
+ public int backlight;
public PwrSample( long time, double ampValue, double voltage, double capacity )
{
@@ -37,11 +38,36 @@
this.voltage = voltage;
this.sampleSynchTime = time;
}
+
+ public PwrSample( long time, double ampValue, double voltage, double capacity, int backlight)
+ {
+ this.current = ampValue;
+ this.capacity = capacity;
+ this.voltage = voltage;
+ this.sampleSynchTime = time;
+ this.backlight = backlight;
+ }
public String toString()
{
return Messages.getString("PwrSample.toString1") + this.sampleSynchTime + Messages.getString("PwrSample.toString2") //$NON-NLS-1$ //$NON-NLS-2$
+ this.current + Messages.getString("PwrSample.toString3") + this.voltage + Messages.getString("PwrSample.toString4") //$NON-NLS-1$ //$NON-NLS-2$
- + this.capacity +Messages.getString("PwrSample.toString5"); //$NON-NLS-1$
+ + this.capacity +Messages.getString("PwrSample.toString5")+ PwrSample.getBacklightInformation(backlight) +Messages.getString("PwrSample.toString6"); //$NON-NLS-1$ //$NON-NLS-2$
}
+
+ public static String getBacklightInformation(int code){
+ switch (code) {
+ case 0:
+ return Messages.getString("PwrSample.backlightUnknown"); //$NON-NLS-1$
+ case 1:
+ return Messages.getString("PwrSample.backlightOn"); //$NON-NLS-1$
+ case 2:
+ return Messages.getString("PwrSample.backlightOff"); //$NON-NLS-1$
+ case 3:
+ return Messages.getString("PwrSample.backlightBlink"); //$NON-NLS-1$
+ default:
+ return Messages.getString("PwrSample.backlightUnknown"); //$NON-NLS-1$
+ }
+ }
+
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PwrTrace.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PwrTrace.java Wed Jun 23 15:05:09 2010 +0300
@@ -18,6 +18,8 @@
package com.nokia.carbide.cpp.pi.power;
import java.util.ArrayList;
+import java.util.Map;
+import java.util.TreeMap;
import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
import com.nokia.carbide.cpp.internal.pi.model.GenericSampledTrace;
@@ -33,6 +35,7 @@
transient private boolean complete = false;
transient private ArrayList<PwrSample> powerChangePoints; // times when power samples change
transient private long maxEndTime;
+ transient private TreeMap<Long, Integer> backlightChangePoints;
private float voltage = 3.7f;
@@ -45,7 +48,8 @@
private double min = 0.0;
private double max = 0.0;
private double synchValue = 0.0;
-
+ private boolean backlightEnabled;
+
transient private int[] sampleTimes;
transient private int[] ampValues;
transient private int[] voltValues;
@@ -53,6 +57,7 @@
transient private double maxAmps = Double.MIN_VALUE;
transient private double minAmps = Double.MAX_VALUE;
transient private double maxPower = 0.0;
+
public GenericTraceGraph getTraceGraph(int graphIndex, int uid)
{
@@ -197,12 +202,19 @@
public void initData()
{
ArrayList<PwrSample> powerChangePoints = new ArrayList<PwrSample>();
+ if(backlightEnabled){
+ backlightChangePoints = new TreeMap<Long, Integer>();
+ }
PwrSample sample = (PwrSample) this.samples.get(0);
long currentTime = sample.sampleSynchTime;
double currentCurrent = sample.current;
double currentVoltage = sample.voltage;
double currentCapacity = sample.capacity;
+ int currentBacklight = sample.backlight;
+ if(backlightEnabled){
+ backlightChangePoints.put(currentTime, currentBacklight);
+ }
for (int i = 1; i < this.samples.size(); i++) {
sample = (PwrSample) this.samples.get(i);
@@ -216,13 +228,22 @@
currentVoltage = sample.voltage;
currentCapacity = sample.capacity;
}
+ if(backlightEnabled){
+ if(sample.backlight != currentBacklight){
+ backlightChangePoints.put(sample.sampleSynchTime, sample.backlight);
+ currentBacklight = sample.backlight;
+ }
+ }
+
}
- sample = powerChangePoints.get(powerChangePoints.size() - 1);
- if ( sample.current != currentCurrent
- || sample.voltage != currentVoltage
- || sample.capacity != currentCapacity) {
- powerChangePoints.add(new PwrSample(currentTime, currentCurrent, currentVoltage, currentCapacity));
+ if(powerChangePoints.size() > 0){
+ sample = powerChangePoints.get(powerChangePoints.size() - 1);
+ if ( sample.current != currentCurrent
+ || sample.voltage != currentVoltage
+ || sample.capacity != currentCapacity) {
+ powerChangePoints.add(new PwrSample(currentTime, currentCurrent, currentVoltage, currentCapacity));
+ }
}
this.powerChangePoints = powerChangePoints;
@@ -319,4 +340,18 @@
public boolean isComplete() {
return this.complete;
}
+
+ public boolean isBacklightEnabled(){
+ //TODO remove this for enabling backlight visualization
+ return false;
+ //return backlightEnabled;
+ }
+
+ public void setBacklightEnabled(boolean backlightEnabled){
+ this.backlightEnabled = backlightEnabled;
+ }
+
+ public Map<Long, Integer> getBacklightChangePoints(){
+ return backlightChangePoints;
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PwrTraceParser.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/PwrTraceParser.java Wed Jun 23 15:05:09 2010 +0300
@@ -34,6 +34,7 @@
{
private boolean debug = false;
private PwrSample[] traceData;
+ private boolean backlightEnabled;
public PwrTraceParser() throws Exception
{
@@ -75,7 +76,7 @@
this.traceVersion = this.getVersion(data);
System.out.println(Messages.getString("PwrTraceParser.powerVersion") + this.traceVersion); //$NON-NLS-1$
- if (traceVersion.indexOf("V1.57") == -1) //$NON-NLS-1$
+ if (traceVersion.indexOf("V1.57") == -1 && traceVersion.indexOf("V1.58") == -1) //$NON-NLS-1$
{
System.out.println(Messages.getString("PwrTraceParser.unsupportedVersion") + this.traceVersion); //$NON-NLS-1$
fis.close();
@@ -95,7 +96,11 @@
long current = 0;
long capacity = 0;
long sampleTime = 0;
-
+ long backlight = 0;
+ backlightEnabled = false;
+ if(traceVersion.indexOf("V1.58") != -1){
+ backlightEnabled = true;
+ }
try
{
while(true)
@@ -103,10 +108,16 @@
capacity = readTUint16(dis);
voltage = readTUint16(dis);
current = readTUint(dis);
+ if(backlightEnabled){
+ backlight = dis.readUnsignedByte();;
+ }
sampleTime = readTUint(dis);
-
- PwrSample sample = new PwrSample(sampleTime, current, voltage, capacity);
-
+ PwrSample sample = null;
+ if(backlightEnabled){
+ sample = new PwrSample(sampleTime, current, voltage, capacity, (int)backlight);
+ }else{
+ sample = new PwrSample(sampleTime, current, voltage, capacity);
+ }
intermediateTraceData.add(sample);
}
}
@@ -178,6 +189,7 @@
private GenericTrace getTrace()
{
PwrTrace trace = new PwrTrace();
+ trace.setBacklightEnabled(backlightEnabled);
for (int i = 0; i < traceData.length; i++)
{
trace.addSample(this.traceData[i]);
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/messages.properties Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.power/src/com/nokia/carbide/cpp/pi/power/messages.properties Wed Jun 23 15:05:09 2010 +0300
@@ -17,7 +17,10 @@
PowerTraceGraph.22=Power Usage Settings\u2026
PowerTraceGraph.23=Power Usage Statistics
PowerTraceGraph.24=mW
+PowerTraceGraph.backlightGraphItem=Backlight
+PowerTraceGraph.backlightTooltip=Backlight "{0}" starting at {1}s
PowerTraceGraph.comma=,
+PowerTraceGraph.newLine=\n
PowerPlugin.0=Power usage
PowerPlugin.powerGraph=Power Graph
PowerPlugin.powerSettingsAction=Power Usage Settings\u2026
@@ -28,13 +31,19 @@
PowerPlugin.showIntervalLineTooltip=Show line with average power usage for the selected interval
PowerTraceGraph.saveSamplesForInterval=Save All Power Samples for Interval...
PowerTraceGraph.saveSamplesHeading=Time (ms),Current (mA),Voltage (mV),Capacity (mAh)\n
+PowerTraceGraph.saveBacklightSamplesHeading=Time (ms),Current (mA),Voltage (mV),Capacity (mAh),Backlight\n
PowerPlugin.pluginTitle=Power Usage
powerFormat=\#\#0 mW
voltageFormat=\#0.0\#\# V
tooltip1=s:
tooltip2=mW @
+PwrSample.backlightBlink=Blinking
+PwrSample.backlightOff=Off
+PwrSample.backlightOn=On
+PwrSample.backlightUnknown=Unknown
PwrSample.toString1=[
PwrSample.toString2=\ ms:
PwrSample.toString3=\ mA:
PwrSample.toString4=\ mV:
-PwrSample.toString5=\ mAh]
+PwrSample.toString5=\ mAh:
+PwrSample.toString6=\ ]
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Thread Priorities
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.priority;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.priority.PriorityPlugin
Bundle-Vendor: Nokia
Bundle-Localization: plugin
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority/src/com/nokia/carbide/cpp/pi/priority/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority/src/com/nokia/carbide/cpp/pi/priority/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.priority.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority/src/com/nokia/carbide/cpp/pi/priority/PriorityPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority/src/com/nokia/carbide/cpp/pi/priority/PriorityPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -304,4 +304,20 @@
public static ImageDescriptor getImageDescriptor(String path) {
return AbstractPiPlugin.imageDescriptorFromPlugin("com.nokia.carbide.cpp.pi.priority", path); //$NON-NLS-1$
}
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority2/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority2/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Thread Priorities 2
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.priority2;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.priority2.Priority2Plugin
Bundle-Vendor: Nokia
Bundle-Localization: plugin
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority2/src/com/nokia/carbide/cpp/pi/priority2/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority2/src/com/nokia/carbide/cpp/pi/priority2/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.priority2.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority2/src/com/nokia/carbide/cpp/pi/priority2/Priority2Plugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.priority2/src/com/nokia/carbide/cpp/pi/priority2/Priority2Plugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -299,4 +299,20 @@
public static ImageDescriptor getImageDescriptor(String path) {
return AbstractPiPlugin.imageDescriptorFromPlugin("com.nokia.carbide.cpp.pi.priority2", path); //$NON-NLS-1$
}
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
+ */
+ public boolean isMandatory() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
+ */
+ public String getTraceDescription() {
+ return getTraceTitle();
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ui/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ui/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator UI
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.ui;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Vendor: Nokia
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ui/src/com/nokia/carbide/cpp/internal/pi/ui/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.ui/src/com/nokia/carbide/cpp/internal/pi/ui/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.ui.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Utilities
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.util;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Vendor: Nokia
Bundle-Localization: plugin
Require-Bundle: org.eclipse.swt,
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/PIConfigXMLLoader.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/PIConfigXMLLoader.java Wed Jun 23 15:05:09 2010 +0300
@@ -40,7 +40,7 @@
// blank file could cause IOException, which is unnecessary. Just return blank model
if (url.openStream().available() == 0) {
- return PIConfigFactory.eINSTANCE.createButtonEventProfileListType();
+ return PIConfigFactory.E_INSTANCE.createButtonEventProfileListType();
}
URI xmlURI = URI.createURI(url.toString());
@@ -67,7 +67,7 @@
Resource r = resFactory.createResource(xmlURI);
EList<EObject> contents = r.getContents();
- PIConfigFactory factory = PIConfigPackage.eINSTANCE.getPIConfigFactory();
+ PIConfigFactory factory = PIConfigPackage.E_INSTANCE.getPIConfigFactory();
DocumentRoot root = factory.createDocumentRoot();
root.setButtonEventProfileList(list);
contents.add(root);
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/PIConfigFactory.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/PIConfigFactory.java Wed Jun 23 15:05:09 2010 +0300
@@ -34,7 +34,7 @@
* <!-- end-user-doc -->
* @generated
*/
- PIConfigFactory eINSTANCE = com.nokia.carbide.cpp.internal.pi.util.config.gen.PIConfig.impl.PIConfigFactoryImpl.init();
+ PIConfigFactory E_INSTANCE = com.nokia.carbide.cpp.internal.pi.util.config.gen.PIConfig.impl.PIConfigFactoryImpl.init();
/**
* Returns a new object of class '<em>Button Event Profile List Type</em>'.
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/PIConfigPackage.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/PIConfigPackage.java Wed Jun 23 15:05:09 2010 +0300
@@ -45,7 +45,7 @@
* <!-- end-user-doc -->
* @generated
*/
- String eNAME = "PIConfig";
+ static final String E_NAME = "PIConfig";
/**
* The package namespace URI.
@@ -53,7 +53,7 @@
* <!-- end-user-doc -->
* @generated
*/
- String eNS_URI = "platform:/resource/com.nokia.carbide.cpp.pi.util/schema/PIConfig.xsd";
+ static final String E_NS_URI = "platform:/resource/com.nokia.carbide.cpp.pi.util/schema/PIConfig.xsd";
/**
* The package namespace name.
@@ -61,7 +61,7 @@
* <!-- end-user-doc -->
* @generated
*/
- String eNS_PREFIX = "PIConfig";
+ static final String E_NS_PREFIX = "PIConfig";
/**
* The singleton instance of the package.
@@ -69,7 +69,7 @@
* <!-- end-user-doc -->
* @generated
*/
- PIConfigPackage eINSTANCE = com.nokia.carbide.cpp.internal.pi.util.config.gen.PIConfig.impl.PIConfigPackageImpl.init();
+ static final PIConfigPackage E_INSTANCE = com.nokia.carbide.cpp.internal.pi.util.config.gen.PIConfig.impl.PIConfigPackageImpl.init();
/**
* The meta object id for the '{@link com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.ButtonEventProfileListTypeImpl <em>Button Event Profile List Type</em>}' class.
@@ -79,7 +79,7 @@
* @see com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.PIConfigPackageImpl#getButtonEventProfileListType()
* @generated
*/
- int BUTTON_EVENT_PROFILE_LIST_TYPE = 0;
+ static final int BUTTON_EVENT_PROFILE_LIST_TYPE = 0;
/**
* The feature id for the '<em><b>Button Event Profile</b></em>' containment reference list.
@@ -88,7 +88,7 @@
* @generated
* @ordered
*/
- int BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE = 0;
+ static final int BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE = 0;
/**
* The feature id for the '<em><b>Button Event Profile Version</b></em>' attribute.
@@ -97,7 +97,7 @@
* @generated
* @ordered
*/
- int BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION = 1;
+ static final int BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION = 1;
/**
* The number of structural features of the '<em>Button Event Profile List Type</em>' class.
@@ -106,7 +106,7 @@
* @generated
* @ordered
*/
- int BUTTON_EVENT_PROFILE_LIST_TYPE_FEATURE_COUNT = 2;
+ static final int BUTTON_EVENT_PROFILE_LIST_TYPE_FEATURE_COUNT = 2;
/**
* The meta object id for the '{@link com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.ButtonEventProfileTypeImpl <em>Button Event Profile Type</em>}' class.
@@ -116,7 +116,7 @@
* @see com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.PIConfigPackageImpl#getButtonEventProfileType()
* @generated
*/
- int BUTTON_EVENT_PROFILE_TYPE = 1;
+ static final int BUTTON_EVENT_PROFILE_TYPE = 1;
/**
* The feature id for the '<em><b>Mapping</b></em>' containment reference list.
@@ -125,7 +125,7 @@
* @generated
* @ordered
*/
- int BUTTON_EVENT_PROFILE_TYPE__MAPPING = 0;
+ static final int BUTTON_EVENT_PROFILE_TYPE__MAPPING = 0;
/**
* The feature id for the '<em><b>Profile Id</b></em>' attribute.
@@ -134,7 +134,7 @@
* @generated
* @ordered
*/
- int BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID = 1;
+ static final int BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID = 1;
/**
* The number of structural features of the '<em>Button Event Profile Type</em>' class.
@@ -143,7 +143,7 @@
* @generated
* @ordered
*/
- int BUTTON_EVENT_PROFILE_TYPE_FEATURE_COUNT = 2;
+ static final int BUTTON_EVENT_PROFILE_TYPE_FEATURE_COUNT = 2;
/**
* The meta object id for the '{@link com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.DocumentRootImpl <em>Document Root</em>}' class.
@@ -153,7 +153,7 @@
* @see com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.PIConfigPackageImpl#getDocumentRoot()
* @generated
*/
- int DOCUMENT_ROOT = 2;
+ static final int DOCUMENT_ROOT = 2;
/**
* The feature id for the '<em><b>Mixed</b></em>' attribute list.
@@ -162,7 +162,7 @@
* @generated
* @ordered
*/
- int DOCUMENT_ROOT__MIXED = 0;
+ static final int DOCUMENT_ROOT__MIXED = 0;
/**
* The feature id for the '<em><b>XMLNS Prefix Map</b></em>' map.
@@ -171,7 +171,7 @@
* @generated
* @ordered
*/
- int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1;
+ static final int DOCUMENT_ROOT__XMLNS_PREFIX_MAP = 1;
/**
* The feature id for the '<em><b>XSI Schema Location</b></em>' map.
@@ -180,7 +180,7 @@
* @generated
* @ordered
*/
- int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2;
+ static final int DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = 2;
/**
* The feature id for the '<em><b>Button Event Profile List</b></em>' containment reference.
@@ -189,7 +189,7 @@
* @generated
* @ordered
*/
- int DOCUMENT_ROOT__BUTTON_EVENT_PROFILE_LIST = 3;
+ static final int DOCUMENT_ROOT__BUTTON_EVENT_PROFILE_LIST = 3;
/**
* The number of structural features of the '<em>Document Root</em>' class.
@@ -198,7 +198,7 @@
* @generated
* @ordered
*/
- int DOCUMENT_ROOT_FEATURE_COUNT = 4;
+ static final int DOCUMENT_ROOT_FEATURE_COUNT = 4;
/**
* The meta object id for the '{@link com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.MappingTypeImpl <em>Mapping Type</em>}' class.
@@ -208,7 +208,7 @@
* @see com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.PIConfigPackageImpl#getMappingType()
* @generated
*/
- int MAPPING_TYPE = 3;
+ static final int MAPPING_TYPE = 3;
/**
* The feature id for the '<em><b>Enum String</b></em>' attribute.
@@ -217,7 +217,7 @@
* @generated
* @ordered
*/
- int MAPPING_TYPE__ENUM_STRING = 0;
+ static final int MAPPING_TYPE__ENUM_STRING = 0;
/**
* The feature id for the '<em><b>Key Code</b></em>' attribute.
@@ -226,7 +226,7 @@
* @generated
* @ordered
*/
- int MAPPING_TYPE__KEY_CODE = 1;
+ static final int MAPPING_TYPE__KEY_CODE = 1;
/**
* The feature id for the '<em><b>Label</b></em>' attribute.
@@ -235,7 +235,7 @@
* @generated
* @ordered
*/
- int MAPPING_TYPE__LABEL = 2;
+ static final int MAPPING_TYPE__LABEL = 2;
/**
* The number of structural features of the '<em>Mapping Type</em>' class.
@@ -244,7 +244,7 @@
* @generated
* @ordered
*/
- int MAPPING_TYPE_FEATURE_COUNT = 3;
+ static final int MAPPING_TYPE_FEATURE_COUNT = 3;
/**
@@ -438,7 +438,7 @@
* @see com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.PIConfigPackageImpl#getButtonEventProfileListType()
* @generated
*/
- EClass BUTTON_EVENT_PROFILE_LIST_TYPE = eINSTANCE.getButtonEventProfileListType();
+ EClass BUTTON_EVENT_PROFILE_LIST_TYPE = E_INSTANCE.getButtonEventProfileListType();
/**
* The meta object literal for the '<em><b>Button Event Profile</b></em>' containment reference list feature.
@@ -446,7 +446,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EReference BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE = eINSTANCE.getButtonEventProfileListType_ButtonEventProfile();
+ EReference BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE = E_INSTANCE.getButtonEventProfileListType_ButtonEventProfile();
/**
* The meta object literal for the '<em><b>Button Event Profile Version</b></em>' attribute feature.
@@ -454,7 +454,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EAttribute BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION = eINSTANCE.getButtonEventProfileListType_ButtonEventProfileVersion();
+ EAttribute BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION = E_INSTANCE.getButtonEventProfileListType_ButtonEventProfileVersion();
/**
* The meta object literal for the '{@link com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.ButtonEventProfileTypeImpl <em>Button Event Profile Type</em>}' class.
@@ -464,7 +464,7 @@
* @see com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.PIConfigPackageImpl#getButtonEventProfileType()
* @generated
*/
- EClass BUTTON_EVENT_PROFILE_TYPE = eINSTANCE.getButtonEventProfileType();
+ EClass BUTTON_EVENT_PROFILE_TYPE = E_INSTANCE.getButtonEventProfileType();
/**
* The meta object literal for the '<em><b>Mapping</b></em>' containment reference list feature.
@@ -472,7 +472,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EReference BUTTON_EVENT_PROFILE_TYPE__MAPPING = eINSTANCE.getButtonEventProfileType_Mapping();
+ EReference BUTTON_EVENT_PROFILE_TYPE__MAPPING = E_INSTANCE.getButtonEventProfileType_Mapping();
/**
* The meta object literal for the '<em><b>Profile Id</b></em>' attribute feature.
@@ -480,7 +480,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EAttribute BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID = eINSTANCE.getButtonEventProfileType_ProfileId();
+ EAttribute BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID = E_INSTANCE.getButtonEventProfileType_ProfileId();
/**
* The meta object literal for the '{@link com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.DocumentRootImpl <em>Document Root</em>}' class.
@@ -490,7 +490,7 @@
* @see com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.PIConfigPackageImpl#getDocumentRoot()
* @generated
*/
- EClass DOCUMENT_ROOT = eINSTANCE.getDocumentRoot();
+ EClass DOCUMENT_ROOT = E_INSTANCE.getDocumentRoot();
/**
* The meta object literal for the '<em><b>Mixed</b></em>' attribute list feature.
@@ -498,7 +498,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EAttribute DOCUMENT_ROOT__MIXED = eINSTANCE.getDocumentRoot_Mixed();
+ EAttribute DOCUMENT_ROOT__MIXED = E_INSTANCE.getDocumentRoot_Mixed();
/**
* The meta object literal for the '<em><b>XMLNS Prefix Map</b></em>' map feature.
@@ -506,7 +506,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = eINSTANCE.getDocumentRoot_XMLNSPrefixMap();
+ EReference DOCUMENT_ROOT__XMLNS_PREFIX_MAP = E_INSTANCE.getDocumentRoot_XMLNSPrefixMap();
/**
* The meta object literal for the '<em><b>XSI Schema Location</b></em>' map feature.
@@ -514,7 +514,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = eINSTANCE.getDocumentRoot_XSISchemaLocation();
+ EReference DOCUMENT_ROOT__XSI_SCHEMA_LOCATION = E_INSTANCE.getDocumentRoot_XSISchemaLocation();
/**
* The meta object literal for the '<em><b>Button Event Profile List</b></em>' containment reference feature.
@@ -522,7 +522,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EReference DOCUMENT_ROOT__BUTTON_EVENT_PROFILE_LIST = eINSTANCE.getDocumentRoot_ButtonEventProfileList();
+ EReference DOCUMENT_ROOT__BUTTON_EVENT_PROFILE_LIST = E_INSTANCE.getDocumentRoot_ButtonEventProfileList();
/**
* The meta object literal for the '{@link com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.MappingTypeImpl <em>Mapping Type</em>}' class.
@@ -532,7 +532,7 @@
* @see com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.impl.PIConfigPackageImpl#getMappingType()
* @generated
*/
- EClass MAPPING_TYPE = eINSTANCE.getMappingType();
+ EClass MAPPING_TYPE = E_INSTANCE.getMappingType();
/**
* The meta object literal for the '<em><b>Enum String</b></em>' attribute feature.
@@ -540,7 +540,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EAttribute MAPPING_TYPE__ENUM_STRING = eINSTANCE.getMappingType_EnumString();
+ EAttribute MAPPING_TYPE__ENUM_STRING = E_INSTANCE.getMappingType_EnumString();
/**
* The meta object literal for the '<em><b>Key Code</b></em>' attribute feature.
@@ -548,7 +548,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EAttribute MAPPING_TYPE__KEY_CODE = eINSTANCE.getMappingType_KeyCode();
+ EAttribute MAPPING_TYPE__KEY_CODE = E_INSTANCE.getMappingType_KeyCode();
/**
* The meta object literal for the '<em><b>Label</b></em>' attribute feature.
@@ -556,7 +556,7 @@
* <!-- end-user-doc -->
* @generated
*/
- EAttribute MAPPING_TYPE__LABEL = eINSTANCE.getMappingType_Label();
+ EAttribute MAPPING_TYPE__LABEL = E_INSTANCE.getMappingType_Label();
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/ButtonEventProfileListTypeImpl.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/ButtonEventProfileListTypeImpl.java Wed Jun 23 15:05:09 2010 +0300
@@ -138,9 +138,8 @@
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE:
- return ((InternalEList<?>)getButtonEventProfile()).basicRemove(otherEnd, msgs);
+ if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE){
+ return ((InternalEList<?>)getButtonEventProfile()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -152,13 +151,14 @@
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE:
- return getButtonEventProfile();
- case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION:
- return getButtonEventProfileVersion();
+ if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE){
+ return getButtonEventProfile();
+ }else if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION){
+ return getButtonEventProfileVersion();
+ }else{
+ return super.eGet(featureID, resolve, coreType);
}
- return super.eGet(featureID, resolve, coreType);
+
}
/**
@@ -169,16 +169,14 @@
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE:
- getButtonEventProfile().clear();
- getButtonEventProfile().addAll((Collection<? extends ButtonEventProfileType>)newValue);
- return;
- case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION:
- setButtonEventProfileVersion((BigDecimal)newValue);
- return;
+ if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE){
+ getButtonEventProfile().clear();
+ getButtonEventProfile().addAll((Collection<? extends ButtonEventProfileType>)newValue);
+ }else if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION){
+ setButtonEventProfileVersion((BigDecimal)newValue);
+ }else{
+ super.eSet(featureID, newValue);
}
- super.eSet(featureID, newValue);
}
/**
@@ -188,15 +186,13 @@
*/
@Override
public void eUnset(int featureID) {
- switch (featureID) {
- case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE:
- getButtonEventProfile().clear();
- return;
- case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION:
- setButtonEventProfileVersion(BUTTON_EVENT_PROFILE_VERSION_EDEFAULT);
- return;
+ if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE){
+ getButtonEventProfile().clear();
+ }else if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION){
+ setButtonEventProfileVersion(BUTTON_EVENT_PROFILE_VERSION_EDEFAULT);
+ }else{
+ super.eUnset(featureID);
}
- super.eUnset(featureID);
}
/**
@@ -206,13 +202,13 @@
*/
@Override
public boolean eIsSet(int featureID) {
- switch (featureID) {
- case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE:
- return buttonEventProfile != null && !buttonEventProfile.isEmpty();
- case PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION:
- return BUTTON_EVENT_PROFILE_VERSION_EDEFAULT == null ? buttonEventProfileVersion != null : !BUTTON_EVENT_PROFILE_VERSION_EDEFAULT.equals(buttonEventProfileVersion);
+ if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE){
+ return buttonEventProfile != null && !buttonEventProfile.isEmpty();
+ }else if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_LIST_TYPE__BUTTON_EVENT_PROFILE_VERSION){
+ return BUTTON_EVENT_PROFILE_VERSION_EDEFAULT == null ? buttonEventProfileVersion != null : !BUTTON_EVENT_PROFILE_VERSION_EDEFAULT.equals(buttonEventProfileVersion);
+ }else{
+ return super.eIsSet(featureID);
}
- return super.eIsSet(featureID);
}
/**
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/ButtonEventProfileTypeImpl.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/ButtonEventProfileTypeImpl.java Wed Jun 23 15:05:09 2010 +0300
@@ -137,11 +137,11 @@
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__MAPPING:
- return ((InternalEList<?>)getMapping()).basicRemove(otherEnd, msgs);
+ if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__MAPPING){
+ return ((InternalEList<?>)getMapping()).basicRemove(otherEnd, msgs);
+ }else{
+ return super.eInverseRemove(otherEnd, featureID, msgs);
}
- return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
@@ -151,13 +151,13 @@
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__MAPPING:
- return getMapping();
- case PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID:
- return getProfileId();
+ if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__MAPPING){
+ return getMapping();
+ }else if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID){
+ return getProfileId();
+ }else{
+ return super.eGet(featureID, resolve, coreType);
}
- return super.eGet(featureID, resolve, coreType);
}
/**
@@ -168,16 +168,14 @@
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__MAPPING:
- getMapping().clear();
- getMapping().addAll((Collection<? extends MappingType>)newValue);
- return;
- case PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID:
- setProfileId((String)newValue);
- return;
+ if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__MAPPING){
+ getMapping().clear();
+ getMapping().addAll((Collection<? extends MappingType>)newValue);
+ }else if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID){
+ setProfileId((String)newValue);
+ }else{
+ super.eSet(featureID, newValue);
}
- super.eSet(featureID, newValue);
}
/**
@@ -187,15 +185,13 @@
*/
@Override
public void eUnset(int featureID) {
- switch (featureID) {
- case PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__MAPPING:
- getMapping().clear();
- return;
- case PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID:
- setProfileId(PROFILE_ID_EDEFAULT);
- return;
+ if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__MAPPING){
+ getMapping().clear();
+ }if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID){
+ setProfileId(PROFILE_ID_EDEFAULT);
+ }else{
+ super.eUnset(featureID);
}
- super.eUnset(featureID);
}
/**
@@ -205,13 +201,13 @@
*/
@Override
public boolean eIsSet(int featureID) {
- switch (featureID) {
- case PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__MAPPING:
- return mapping != null && !mapping.isEmpty();
- case PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID:
- return PROFILE_ID_EDEFAULT == null ? profileId != null : !PROFILE_ID_EDEFAULT.equals(profileId);
+ if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__MAPPING){
+ return mapping != null && !mapping.isEmpty();
+ }else if(featureID == PIConfigPackage.BUTTON_EVENT_PROFILE_TYPE__PROFILE_ID){
+ return PROFILE_ID_EDEFAULT == null ? profileId != null : !PROFILE_ID_EDEFAULT.equals(profileId);
+ }else{
+ return super.eIsSet(featureID);
}
- return super.eIsSet(featureID);
}
/**
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/MappingTypeImpl.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/MappingTypeImpl.java Wed Jun 23 15:05:09 2010 +0300
@@ -228,7 +228,7 @@
case PIConfigPackage.MAPPING_TYPE__ENUM_STRING:
return getEnumString();
case PIConfigPackage.MAPPING_TYPE__KEY_CODE:
- return new Long(getKeyCode());
+ return Long.valueOf(getKeyCode());
case PIConfigPackage.MAPPING_TYPE__LABEL:
return getLabel();
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/PIConfigFactoryImpl.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/PIConfigFactoryImpl.java Wed Jun 23 15:05:09 2010 +0300
@@ -140,7 +140,7 @@
*/
@Deprecated
public static PIConfigPackage getPackage() {
- return PIConfigPackage.eINSTANCE;
+ return PIConfigPackage.E_INSTANCE;
}
} //PIConfigFactoryImpl
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/PIConfigPackageImpl.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/impl/PIConfigPackageImpl.java Wed Jun 23 15:05:09 2010 +0300
@@ -37,7 +37,7 @@
* <!-- end-user-doc -->
* @generated
*/
-public class PIConfigPackageImpl extends EPackageImpl implements PIConfigPackage {
+public final class PIConfigPackageImpl extends EPackageImpl implements PIConfigPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -77,12 +77,12 @@
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
- * @see com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.PIConfigPackage#eNS_URI
+ * @see com.nokia.carbide.cpp.pi.util.config.gen.PIConfig.PIConfigPackage#E_NS_URI
* @see #init()
* @generated
*/
private PIConfigPackageImpl() {
- super(eNS_URI, PIConfigFactory.eINSTANCE);
+ super(E_NS_URI, PIConfigFactory.E_INSTANCE);
}
/**
@@ -109,16 +109,16 @@
* already been initialized.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #eNS_URI
+ * @see #E_NS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static PIConfigPackage init() {
- if (isInited) return (PIConfigPackage)EPackage.Registry.INSTANCE.getEPackage(PIConfigPackage.eNS_URI);
+ if (isInited) return (PIConfigPackage)EPackage.Registry.INSTANCE.getEPackage(PIConfigPackage.E_NS_URI);
// Obtain or create and register package
- PIConfigPackageImpl thePIConfigPackage = (PIConfigPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof PIConfigPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new PIConfigPackageImpl());
+ PIConfigPackageImpl thePIConfigPackage = (PIConfigPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(E_NS_URI) instanceof PIConfigPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(E_NS_URI) : new PIConfigPackageImpl());
isInited = true;
@@ -339,9 +339,9 @@
isInitialized = true;
// Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
+ setName(E_NAME);
+ setNsPrefix(E_NS_PREFIX);
+ setNsURI(E_NS_URI);
// Obtain other dependent packages
XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
@@ -373,7 +373,7 @@
initEAttribute(getMappingType_Label(), theXMLTypePackage.getString(), "label", null, 0, 1, MappingType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Create resource
- createResource(eNS_URI);
+ createResource(E_NS_URI);
// Create annotations
// http:///org/eclipse/emf/ecore/util/ExtendedMetaData
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/util/PIConfigAdapterFactory.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/util/PIConfigAdapterFactory.java Wed Jun 23 15:05:09 2010 +0300
@@ -53,7 +53,7 @@
*/
public PIConfigAdapterFactory() {
if (modelPackage == null) {
- modelPackage = PIConfigPackage.eINSTANCE;
+ modelPackage = PIConfigPackage.E_INSTANCE;
}
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/util/PIConfigResourceFactoryImpl.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/util/PIConfigResourceFactoryImpl.java Wed Jun 23 15:05:09 2010 +0300
@@ -52,7 +52,7 @@
public PIConfigResourceFactoryImpl() {
super();
extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE));
- extendedMetaData.putPackage(null, PIConfigPackage.eINSTANCE);
+ extendedMetaData.putPackage(null, PIConfigPackage.E_INSTANCE);
}
/**
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/util/PIConfigSwitch.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/util/PIConfigSwitch.java Wed Jun 23 15:05:09 2010 +0300
@@ -58,7 +58,7 @@
*/
public PIConfigSwitch() {
if (modelPackage == null) {
- modelPackage = PIConfigPackage.eINSTANCE;
+ modelPackage = PIConfigPackage.E_INSTANCE;
}
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/util/PIConfigXMLProcessor.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/internal/pi/util/config/gen/PIConfig/util/PIConfigXMLProcessor.java Wed Jun 23 15:05:09 2010 +0300
@@ -42,7 +42,7 @@
*/
public PIConfigXMLProcessor() {
super(new EPackageRegistryImpl(EPackage.Registry.INSTANCE));
- extendedMetaData.putPackage(null, PIConfigPackage.eINSTANCE);
+ extendedMetaData.putPackage(null, PIConfigPackage.E_INSTANCE);
}
/**
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/AWTColorPalette.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/AWTColorPalette.java Wed Jun 23 15:05:09 2010 +0300
@@ -24,7 +24,7 @@
*
*/
-public class AWTColorPalette {
+public final class AWTColorPalette {
private static CacheMap<RGB, java.awt.Color> palette = new CacheMap<RGB, java.awt.Color>();
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/ColorPalette.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/ColorPalette.java Wed Jun 23 15:05:09 2010 +0300
@@ -26,7 +26,7 @@
*
*/
-public class ColorPalette {
+public final class ColorPalette {
private static CacheMap<RGB, Color> palette = new CacheMap<RGB, Color>();
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/DataMiningPalette.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/DataMiningPalette.java Wed Jun 23 15:05:09 2010 +0300
@@ -30,29 +30,30 @@
public class DataMiningPalette {
- private Map<Object, RGB> palette = new HashMap<Object, RGB>();
+ private transient final Map<Object, RGB> palette = new HashMap<Object, RGB>();
private boolean haveEntry(Object entry) {
return palette.containsKey(entry);
}
- private boolean haveColor(RGB color) {
+ private boolean haveColor(final RGB color) {
return palette.containsValue(color);
}
- private void add(Object entry, RGB color) {
+ private void add(final Object entry, final RGB color) {
palette.put(entry, color);
}
- private void update(Object entry, RGB color) {
+ private void update(final Object entry, final RGB color) {
palette.remove(entry);
palette.put(entry, color);
}
private RGB hsv2rgb(int hue, double saturation, double value) {
- if (hue >= 360)
+ if (hue >= 360){
hue %= 360;
+ }
int Hi = (hue / 60) % 6;
double f = (double) hue / (double) 60 - Hi;
@@ -141,9 +142,9 @@
RGB myRGB = new RGB(channelValue[indexR], channelValue[indexG], channelValue[indexB]);
- if (haveColor(myRGB))
+ if (haveColor(myRGB)){
continue;
-
+ }
add(entry, myRGB);
if (!entryListItr.hasNext())
@@ -182,9 +183,9 @@
RGB myRGB = hsv2rgb(hueEntry[i], saturation, saturation);
- if (haveColor(myRGB))
+ if (haveColor(myRGB)){
continue;
-
+ }
add(entry, myRGB);
--remain;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/GeneralMessages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/GeneralMessages.java Wed Jun 23 15:05:09 2010 +0300
@@ -47,10 +47,11 @@
MessageBox messageBox = new MessageBox(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
SWT.ICON_ERROR | SWT.OK | SWT.SYSTEM_MODAL);
- if (error == null)
+ if (error == null){
displayMessage = Messages.getString("GeneralMessages.unknownError"); //$NON-NLS-1$
- else
+ }else{
displayMessage = error;
+ }
messageBox.setMessage(displayMessage);
messageBox.setText(Messages.getString("GeneralMessages.piError")); //$NON-NLS-1$
messageBox.open();
@@ -129,11 +130,11 @@
return result;
}
- public static void PiLog(String message, int severity) {
- PiLog(message, severity, new Throwable());
+ public static void piLog(String message, int severity) {
+ piLog(message, severity, new Throwable());
}
- public static void PiLog(String message, int severity, Throwable throwable) {
+ public static void piLog(String message, int severity, Throwable throwable) {
switch (severity) {
case IStatus.OK:
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.util.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/PIUtilPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/PIUtilPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -30,7 +30,7 @@
//The shared instance.
private static PIUtilPlugin plugin;
- private static void setPlugin(PIUtilPlugin newPlugin)
+ private static void setPlugin(final PIUtilPlugin newPlugin)
{
plugin = newPlugin;
}
@@ -45,14 +45,14 @@
/**
* This method is called upon plug-in activation
*/
- public void start(BundleContext context) throws Exception {
+ public void start(final BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/
- public void stop(BundleContext context) throws Exception {
+ public void stop(final BundleContext context) throws Exception {
super.stop(context);
setPlugin(null);
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/SourceLookup.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/SourceLookup.java Wed Jun 23 15:05:09 2010 +0300
@@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.logging.Logger;
import java.util.regex.Pattern;
import org.eclipse.cdt.core.CCorePlugin;
@@ -63,8 +64,9 @@
private static SourceLookup instance = null;
public static SourceLookup getInstance() {
- if (instance == null)
+ if (instance == null){
instance = new SourceLookup();
+ }
return instance;
}
@@ -72,8 +74,8 @@
// singleton
}
- public void lookupAndopenEditorWithHighlight(String symbolName, String binaryName) {
- IASTFileLocation[] locations = lookupLocations(symbolName, binaryName);
+ public void lookupAndopenEditorWithHighlight(final String symbolName, final String binaryName) {
+ final IASTFileLocation[] locations = lookupLocations(symbolName, binaryName);
final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
if (locations.length <= 0) {
GeneralMessages.showErrorMessage(Messages.getString("SourceLookup.notfound") + "\n" + symbolName); //$NON-NLS-1$ //$NON-NLS-2$
@@ -81,7 +83,7 @@
}
if (locations.length > 1) {
- SourceLookupFileChooserDialog dialog = new SourceLookupFileChooserDialog(shell, locations);
+ final SourceLookupFileChooserDialog dialog = new SourceLookupFileChooserDialog(shell, locations);
if (dialog.open() == Window.OK && dialog.getLocation() != null) {
openEditorWithHighlight(dialog.getLocation());
}
@@ -90,9 +92,9 @@
}
}
- private void openEditorWithHighlight(IASTFileLocation location) {
- IPath path = new Path(location.getFileName());
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
+ private void openEditorWithHighlight(final IASTFileLocation location) {
+ final IPath path = new Path(location.getFileName());
+ final IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
if (file == null) {
return;
@@ -107,7 +109,7 @@
}
if (editor != null && editor instanceof ITextEditor) {
- ITextEditor textEditor = (ITextEditor)editor;
+ final ITextEditor textEditor = (ITextEditor)editor;
int nodeOffset = location.getNodeOffset();
int nodeLength = location.getNodeLength();
int offset;
@@ -131,14 +133,14 @@
}
}
- private boolean typeEqual(String param, IType type) {
+ private boolean typeEqual(final String param, final IType type) {
class TypeAttribute {
- boolean isSigned = true; // Symbian still default to signed
- boolean isConst = true;
- String typeWithoutModifier = ""; //$NON-NLS-1$
+ private transient boolean isSigned = true; // Symbian still default to signed
+ private transient boolean isConst = true;
+ private transient String typeWithoutModifier = ""; //$NON-NLS-1$
- TypeAttribute(String typeString) {
+ TypeAttribute(final String typeString) {
// In general we don't not have to care about too much, just trim out
// signed/unsigned/const modifier and take note. We take the rest of them
// and compare them after removing spaces
@@ -159,7 +161,7 @@
typeWithoutModifier = typeWithoutModifier.replaceAll("long int", "long"); //$NON-NLS-1$ //$NON-NLS-2$
}
- boolean isSameType(TypeAttribute attribute) {
+ private boolean isSameType(TypeAttribute attribute) {
if (isSigned == attribute.isSigned &&
isConst == attribute.isConst &&
typeWithoutModifier != null &&
@@ -183,8 +185,8 @@
boolean needMatchingArg = true;
// drop everything after )
- if (Signature.indexOf(")") > 0 ) { //$NON-NLS-1$
- Signature = Signature.substring(0, Signature.indexOf(")")); //$NON-NLS-1$
+ if (Signature.indexOf(')') > 0 ) { //$NON-NLS-1$
+ Signature = Signature.substring(0, Signature.indexOf(')')); //$NON-NLS-1$
}
String[] signatureSplit = Signature.split("[(),]"); //$NON-NLS-1$
@@ -274,18 +276,20 @@
IProject[] projects= ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject project: projects) {
- if (CarbideBuilderPlugin.getBuildManager().isCarbideProject(project) == false) {
+ if (!CarbideBuilderPlugin.getBuildManager().isCarbideProject(project)) {
continue;
}
ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
- if (cpi == null)
+ if (cpi == null){
continue;
+ }
List<ICarbideBuildConfiguration> allConfig = cpi.getBuildConfigurations();
- if (allConfig == null)
+ if (allConfig == null){
continue;
+ }
boolean isEligibleProject = false;
for (ICarbideBuildConfiguration config : allConfig) {
@@ -294,7 +298,7 @@
String projectFileName = new java.io.File(projectExePath).getName().toLowerCase();
String binaryFileName = new java.io.File(binaryName).getName().toLowerCase();
- if (projectFileName.equals(binaryFileName) == true) {
+ if (projectFileName.equals(binaryFileName)) {
isEligibleProject = true;
}
}
@@ -344,7 +348,7 @@
return locations.toArray(new IASTFileLocation[0]);
}
- IASTFileLocation[] lookupLocationsFromIndex(String symbolName, IIndex index) {
+ private IASTFileLocation[] lookupLocationsFromIndex(String symbolName, IIndex index) {
IIndexBinding[] bindings = new IIndexBinding[0];
ArrayList<IASTFileLocation> locations = new ArrayList<IASTFileLocation>();
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/SourceLookupFileChooserDialog.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/SourceLookupFileChooserDialog.java Wed Jun 23 15:05:09 2010 +0300
@@ -43,19 +43,19 @@
public class SourceLookupFileChooserDialog extends TitleAreaDialog {
- IASTFileLocation[] locations = null;
- IASTFileLocation selectedLocation = null;
+ private IASTFileLocation[] locations = null;
+ private IASTFileLocation selectedLocation = null;
// control
private Composite composite = null;
private Table table = null;
- protected SourceLookupFileChooserDialog(Shell arg0, IASTFileLocation[] locs) {
+ protected SourceLookupFileChooserDialog(final Shell arg0, final IASTFileLocation[] locs) {
super(arg0);
locations = locs;
}
- public Control createDialogArea(Composite parent) {
+ public Control createDialogArea(final Composite parent) {
// use image from support plugin
setDefaultImage(CarbideUIPlugin.getSharedImages().getImageDescriptor(ICarbideSharedImages.IMG_CARBIDE_C_ICON_16_16).createImage());
getShell().setText(Messages.getString("SourceLookupFileChooserDialog.text")); //$NON-NLS-1$
@@ -71,25 +71,25 @@
table = new Table(composite, SWT.SINGLE);
table.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent arg0) {
+ public void widgetDefaultSelected(final SelectionEvent arg0) {
}
- public void widgetSelected(SelectionEvent arg0) {
+ public void widgetSelected(final SelectionEvent arg0) {
selectedLocation = (IASTFileLocation)table.getSelection()[0].getData();
}
});
table.addMouseListener(new MouseListener(){
// allow double click instead of OK
- public void mouseDoubleClick(MouseEvent arg0) {
+ public void mouseDoubleClick(final MouseEvent arg0) {
selectedLocation = (IASTFileLocation)table.getSelection()[0].getData();
okPressed();
}
- public void mouseDown(MouseEvent arg0) {
+ public void mouseDown(final MouseEvent arg0) {
}
- public void mouseUp(MouseEvent arg0) {
+ public void mouseUp(final MouseEvent arg0) {
}
});
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/TableColorPalette.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/TableColorPalette.java Wed Jun 23 15:05:09 2010 +0300
@@ -29,19 +29,17 @@
abstract public class TableColorPalette implements ITableColorPalette {
- private final int channelValue[] = { 0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF };
+ private transient final int channelValue[] = { 0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF };
- private Map<Object, Color> palette = new HashMap<Object, Color>();
- private int currentColorIndex = 0;
+ private transient Map<Object, Color> palette = new HashMap<Object, Color>();
+ private transient int currentColorIndex = 0;
abstract public RGB getConstantRGB(Object entry);
- public TableColorPalette() {
- }
// Windows palette default from here
//http://www.mozilla.org/docs/refList/user-interface/visual/colorpalette/
- int defaultPalette[][] = {{255,255,0}, {0,255,255}, {255,102,51},
+ private transient int defaultPalette[][] = {{255,255,0}, {0,255,255}, {255,102,51},
{128,128,0}, {0,0,128}, {0,255,0},
{0,128,0}, {128,0,0}, {0,128,128},
{0,55,60}, {204,153,102}, {0,153,255},
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/TestDataMiningPalette.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/TestDataMiningPalette.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,6 +20,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import org.eclipse.swt.SWT;
@@ -48,24 +49,25 @@
private Shell sShell = null;
- private Map<Button,CLabel> dataMiningColors = new HashMap<Button,CLabel>();
- private DataMiningPalette palette = new DataMiningPalette();
- private ArrayList<Integer> sosThreadlist = new ArrayList<Integer>();
- private ArrayList<Integer> threadlist = new ArrayList<Integer>();
+ private final Map<Button,CLabel> dataMiningColors = new HashMap<Button,CLabel>();
+ private final DataMiningPalette palette = new DataMiningPalette();
+ private final List<Integer> sosThreadlist = new ArrayList<Integer>();
+ private final List<Integer> threadlist = new ArrayList<Integer>();
/**
* @param args
*/
- public static void main(String[] args) {
+ public static void main(final String[] args) {
Display display = Display.getDefault();
TestDataMiningPalette thisClass = new TestDataMiningPalette();
thisClass.createSShell();
thisClass.sShell.open();
while (!thisClass.sShell.isDisposed()) {
- if (!display.readAndDispatch())
+ if (!display.readAndDispatch()){
display.sleep();
+ }
}
display.dispose();
}
@@ -102,7 +104,7 @@
button.setText(entry.toString());
button.setBackground(new Color(Display.getCurrent(), palette.getRGB(entry)));
button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ public void widgetSelected(final SelectionEvent e) {
Integer index = Integer.valueOf(button.getText());
if(palette.recolorEntryDialog(sShell, index))
{
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/TestTableColorPalette.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/TestTableColorPalette.java Wed Jun 23 15:05:09 2010 +0300
@@ -34,18 +34,19 @@
public class TestTableColorPalette {
private Shell sShell = null;
- private Map<Button,CLabel> testColorsMap = new HashMap<Button,CLabel>();
- private FunctionColorPalette palette = new FunctionColorPalette();
+ private final Map<Button,CLabel> testColorsMap = new HashMap<Button,CLabel>();
+ private final FunctionColorPalette palette = new FunctionColorPalette();
- public static void main(String[] args) {
+ public static void main(final String[] args) {
Display display = Display.getDefault();
TestTableColorPalette thisClass = new TestTableColorPalette();
thisClass.createSShell();
thisClass.sShell.open();
while (!thisClass.sShell.isDisposed()) {
- if (!display.readAndDispatch())
+ if (!display.readAndDispatch()){
display.sleep();
+ }
}
display.dispose();
}
@@ -69,7 +70,7 @@
button.setText(i.toString());
button.setBackground(palette.getColor(i.toString()));
button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ public void widgetSelected(final SelectionEvent e) {
if(palette.recolorEntryDialog(sShell, finalI))
{
Color myColor = palette.getColor(finalI);
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/ThreadColorPalette.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/ThreadColorPalette.java Wed Jun 23 15:05:09 2010 +0300
@@ -22,14 +22,14 @@
public class ThreadColorPalette extends TableColorPalette {
@Override
- public RGB getConstantRGB(Object entry) {
+ public RGB getConstantRGB(final Object entry) {
assert (entry instanceof String);
//threadName = sample.thread.process.name + "::" + sample.thread.threadName + "_" + sample.thread.threadId;
String string = (String)entry;
- int lastIndexOf = string.lastIndexOf("_");
+ int lastIndexOf = string.lastIndexOf('_');
String threadName[] = string.substring(0, lastIndexOf).split("::"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -48,13 +48,13 @@
String pro_string = threadName[0];
String thr_string = threadName[1];
int mark;
- if (pro_string.indexOf(".") != -1) //$NON-NLS-1$
- mark = pro_string.indexOf("."); //EKA2 //$NON-NLS-1$
- else if (pro_string.indexOf('[') != -1)
+ if (pro_string.indexOf('.') != -1){ //$NON-NLS-1$
+ mark = pro_string.indexOf('.'); //EKA2 //$NON-NLS-1$
+ }else if (pro_string.indexOf('[') != -1){
mark = pro_string.indexOf('['); //EKA1
- else
+ }else{
return null;
-
+ }
pro_string = pro_string.substring(0, mark);
if (pro_string.equalsIgnoreCase("EKern") && thr_string.toUpperCase().startsWith("NULL")) { //$NON-NLS-1$ //$NON-NLS-2$
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator Import Wizards
Bundle-SymbolicName: com.nokia.carbide.cpp.pi.wizards;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.wizards.WizardsPlugin
Bundle-Vendor: Nokia
Bundle-Localization: plugin
@@ -21,6 +21,7 @@
com.nokia.carbide.cpp.ui,
com.nokia.carbide.cpp.pi.button,
com.nokia.carbide.cpp.pi,
- com.nokia.cpp.utils.core
+ com.nokia.cpp.utils.core,
+ com.nokia.s60tools.ui;bundle-version="1.5.0"
Bundle-ActivationPolicy: lazy
Export-Package: com.nokia.carbide.cpp.pi.wizards;x-friends:="com.nokia.carbide.cpp.pi.wizard.tests"
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/icons/PI_Meter_16x16.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/icons/PI_Meter_20x20.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/icons/open_key_press_profile_wizard.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/icons/open_pi_wizard.png has changed
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/plugin.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/plugin.xml Wed Jun 23 15:05:09 2010 +0300
@@ -25,4 +25,43 @@
name="Performance Investigator">
</category>
</extension>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ name="Carbide Extensions"
+ id="com.nokia.s60tools">
+ </category>
+ <view
+ name="Performance Investigator"
+ icon="icons/PI_Meter_16x16.png"
+ category="com.nokia.s60tools"
+ class="com.nokia.carbide.cpp.internal.pi.wizards.ui.views.PIView"
+ id="com.nokia.carbide.cpp.internal.pi.wizards.ui.views.PIView">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ description="Performance Investigator"
+ id="com.nokia.carbide.cpp.pi.wizards.actionSet"
+ label="Performance Investigator"
+ visible="true">
+ <menu
+ id="com.nokia.carbide.cpp.ui.CarbideMenu"
+ label="&Carbide">
+ <separator
+ name="com.nokia.s60tools.ToolsMenuGroup">
+ </separator>
+ </menu>
+ <action
+ class="com.nokia.carbide.cpp.internal.pi.wizards.ui.actions.ToolbarShortcutAction"
+ icon="icons/PI_Meter_16x16.png"
+ id="com.nokia.carbide.cpp.internal.pi.wizards.ui.actions.ToolbarShortcutAction"
+ label="Performance Investigator"
+ menubarPath="com.nokia.carbide.cpp.ui.CarbideMenu/CarbideExtensions"
+ tooltip="Performance Investigator">
+ </action>
+ </actionSet>
+ </extension>
</plugin>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/model/SessionHandler.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.carbide.cpp.internal.pi.wizards.model;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+
+import com.nokia.carbide.cpp.pi.PiPlugin;
+import com.nokia.carbide.cpp.pi.wizards.WizardsPlugin;
+
+public final class SessionHandler {
+
+ private static final String SESSION_DATA_FILE_NAME = "PerformanceInvestigatorSession.bin"; //$NON-NLS-1$
+ private static final IPath SESSION_DATA_FILE_PATH = PiPlugin.getDefault()
+ .getStateLocation().append(SESSION_DATA_FILE_NAME);
+ private static SessionHandler instance;
+
+ public static SessionHandler getInstance() {
+ if (instance == null) {
+ instance = new SessionHandler();
+ }
+ return instance;
+ }
+
+ private SessionHandler() {
+
+ }
+
+ /**
+ * Saves given trace files.
+ *
+ * @param files
+ * @return <code>true</code> if trace files are saved otherwise
+ * <code>false</code> is returned
+ */
+ public boolean saveTraceFiles(List<TraceFile> files) {
+ FileOutputStream fos = null;
+ ObjectOutputStream out = null;
+ try {
+ fos = new FileOutputStream(SESSION_DATA_FILE_PATH.toFile());
+ out = new ObjectOutputStream(fos);
+ out.writeObject(files);
+ out.flush();
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ } finally {
+ if (fos != null) {
+ try {
+ fos.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ /**
+ * Load trace files from storage
+ *
+ * @return array of the trace files
+ */
+ @SuppressWarnings("unchecked")
+ public TraceFile[] loadTraceFile() {
+ File file = SESSION_DATA_FILE_PATH.toFile();
+ if (!file.exists()) {
+ return new TraceFile[0];
+ }
+ FileInputStream fis = null;
+ ObjectInputStream in = null;
+ try {
+ fis = new FileInputStream(file);
+ in = new ObjectInputStream(fis);
+ List<TraceFile> traceFiles = (List<TraceFile>) in.readObject();
+ return traceFiles.toArray(new TraceFile[0]);
+ } catch (Exception e) {
+ return new TraceFile[0];
+ } finally {
+ if (fis != null) {
+ try {
+ fis.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ /**
+ * Removes given file.
+ *
+ * @param traceFile
+ * file to be removed
+ */
+ public void removeTraceFile(TraceFile traceFile) {
+ if (traceFile == null) {
+ return;
+ }
+ List<TraceFile> traceFiles = new ArrayList<TraceFile>();
+ traceFiles.addAll(Arrays.asList(loadTraceFile()));
+ boolean removed = traceFiles.remove(traceFile);
+ if (removed) {
+ WizardsPlugin.getDefault().getPreferenceStore().setValue(
+ traceFile.getTraceFilePath().toString(), false);
+ saveTraceFiles(traceFiles);
+ }
+ }
+
+ /**
+ * Get TraceFile with given path.
+ *
+ * @param path
+ * @return instance of the TraceFile if instance is found with given path
+ * otherwise null is returned
+ */
+ public TraceFile getTraceFile(IPath path) {
+ if (path == null) {
+ return null;
+ }
+ List<TraceFile> traceFiles = new ArrayList<TraceFile>();
+ traceFiles.addAll(Arrays.asList(loadTraceFile()));
+ for (TraceFile traceFile : traceFiles) {
+ if (path.equals(traceFile.getTraceFilePath())) {
+ return traceFile;
+ }
+
+ }
+ return null;
+ }
+
+ /**
+ * Add given file.
+ *
+ * @param traceFile
+ * file to be added
+ */
+ public void addTraceFile(TraceFile traceFile) {
+ List<TraceFile> traceFileList = new ArrayList<TraceFile>();
+ traceFileList.addAll(Arrays.asList(loadTraceFile()));
+ traceFileList.add(traceFile);
+ saveTraceFiles(traceFileList);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/model/TraceFile.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.carbide.cpp.internal.pi.wizards.model;
+
+import java.io.Serializable;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+public class TraceFile implements Serializable {
+
+ private static final long serialVersionUID = 8762830613454627945L;
+
+ private String traceFilePath;
+ private String projectName;
+ private String sdkName;
+ private long importTime;
+ private long traceFileSize;
+ private long traceLengthInTime;
+ private int[] pluginIds;
+
+ /**
+ * Constructor
+ *
+ * @param traceFilePath location of the trace file
+ * @param projectName trace file is imported under the given project name
+ * @param sdkName SDK name
+ * @param traceFileSize size of the trace file
+ * @param traceLengthInTime trace time of the trace file
+ * @param pluginIds list of the plugin's id
+ */
+ public TraceFile(IPath traceFilePath, String projectName, String sdkName, long traceFileSize, long traceLengthInTime, int[] pluginIds) {
+ this.traceFilePath = traceFilePath.toOSString();
+ this.projectName = projectName;
+ this.sdkName = sdkName;
+ this.importTime = System.currentTimeMillis();
+ this.traceFileSize = traceFileSize;
+ this.traceLengthInTime = traceLengthInTime;
+ this.pluginIds = pluginIds;
+ }
+
+ /**
+ * @return the traceFilePath
+ */
+ public IPath getTraceFilePath() {
+ return new Path(traceFilePath);
+ }
+
+ /**
+ * @param traceFilePath
+ * the traceFilePath to set
+ */
+ public void setTraceFilePath(IPath traceFilePath) {
+ this.traceFilePath = traceFilePath.toString();
+ }
+
+ /**
+ * @return the projectName
+ */
+ public String getProjectName() {
+ return projectName;
+ }
+
+ /**
+ * @param projectName
+ * the projectName to set
+ */
+ public void setProjectName(String projectName) {
+ this.projectName = projectName;
+ }
+
+ /**
+ * @return the sdkName
+ */
+ public String getSdkName() {
+ return sdkName;
+ }
+
+ /**
+ * @param sdkName
+ * the sdkName to set
+ */
+ public void setSdkName(String sdkName) {
+ this.sdkName = sdkName;
+ }
+
+ /**
+ * @return the importTime
+ */
+ public long getImportTime() {
+ return importTime;
+ }
+
+ /**
+ * @param importTime
+ * the importTime to set
+ */
+ public void setImportTime(long importTime) {
+ this.importTime = importTime;
+ }
+
+ /**
+ * @return the traceFileSize
+ */
+ public long getTraceFileSize() {
+ return traceFileSize;
+ }
+
+ /**
+ * @param traceFileSize
+ * the traceFileSize to set
+ */
+ public void setTraceFileSize(long traceFileSize) {
+ this.traceFileSize = traceFileSize;
+ }
+
+ /**
+ * @return the traceLengthInTime
+ */
+ public long getTraceLengthInTime() {
+ return traceLengthInTime;
+ }
+
+ /**
+ * @param traceLengthInTime
+ * the traceLengthInTime to set
+ */
+ public void setTraceLengthInTime(long traceLengthInTime) {
+ this.traceLengthInTime = traceLengthInTime;
+ }
+
+ /**
+ * @return the pluginIds
+ */
+ public int[] getPluginIds() {
+ return pluginIds;
+ }
+
+ /**
+ * @param pluginIds the pluginIds to set
+ */
+ public void setPluginIds(int[] pluginIds) {
+ this.pluginIds = pluginIds;
+ }
+
+ /**
+ * Checks if trace files are equal. Two trace files are equal if
+ * their path is the same
+ */
+ public boolean equals(Object other) {
+ if (this == other)
+ return true;
+
+ if (!(other instanceof TraceFile))
+ return false;
+
+ TraceFile othr = (TraceFile)other;
+ return this.getTraceFilePath().equals(othr.getTraceFilePath());
+ }
+
+}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/AbstractBaseGroup.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/AbstractBaseGroup.java Wed Jun 23 15:05:09 2010 +0300
@@ -24,6 +24,7 @@
import java.util.List;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
@@ -40,7 +41,6 @@
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
-import com.nokia.carbide.cpp.internal.pi.analyser.StreamFileParser;
import com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace;
import com.nokia.carbide.cpp.internal.pi.utils.PIUtilities;
@@ -87,6 +87,7 @@
private List<ProfilerDataPlugins> profilerDataFiles = new ArrayList<ProfilerDataPlugins>();
protected INewPIWizardSettings wizardSettings;
+ private boolean timeAndSizeEnabled;
/**
* Constructor
@@ -95,11 +96,13 @@
* instance of parent Composite
* @param wizardSettings
* instance of the INewPIWizardSettings
+ * @param timeAndSizeEnabled is used to store trace data file during the tracing
*/
public AbstractBaseGroup(Composite parent,
- INewPIWizardSettings wizardSettings) {
+ INewPIWizardSettings wizardSettings, boolean timeAndSizeEnabled) {
super(parent, SWT.NONE);
this.wizardSettings = wizardSettings;
+ this.timeAndSizeEnabled = timeAndSizeEnabled;
// set default layout
this.setLayout(new GridLayout(1, false));
this.setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -116,6 +119,8 @@
*/
protected abstract void createContent();
+ public abstract IStatus validateContent(NewPIWizard wizardPage);
+
protected abstract Table getTable();
/**
@@ -125,10 +130,17 @@
* to hide
*/
public void setVisible(Composite hideComposite) {
- setVisible(true);
+ if (hideComposite.getLayoutData() instanceof GridData) {
+ ((GridData) hideComposite.getLayoutData()).exclude = true;
+ }
+ if (this.getLayoutData() instanceof GridData) {
+ ((GridData) this.getLayoutData()).exclude = false;
+ }
setLocation(hideComposite.getLocation());
setSize(hideComposite.getSize());
+ setVisible(true);
hideComposite.setVisible(false);
+ wizardSettings.validatePage();
}
/**
@@ -136,10 +148,12 @@
*
* @param path
* selected profile data file
+ * @param time of the used to trace
+ * @param size of the trace data file
* @throws IllegalArgumentException
- * if given file is not valid profile data file
+ * if given file is not valid profile data file
*/
- public void addProfileDataFile(IPath path) throws IllegalArgumentException {
+ public void addProfilerDataFile(IPath path, long time, long size) throws IllegalArgumentException {
boolean exists = false;
for (ProfilerDataPlugins pdp : profilerDataFiles) {
if (pdp.getProfilerDataPath().equals(path)) {
@@ -153,17 +167,58 @@
if (!file.isFile() || file.length() <= 0) {
throw new IllegalArgumentException();
}
- new StreamFileParser(file).allTraceType();
- profilerDataFiles.add(new ProfilerDataPlugins(path,
- getPluginsForTraceFile(path)));
+
+ ProfilerDataPlugins dataPlugins = new ProfilerDataPlugins(path,
+ getPluginsForTraceFile(path));
+ if(timeAndSizeEnabled){
+ dataPlugins.updateTimeAndSize(time, size);
+ }
+ profilerDataFiles.add(dataPlugins);
} catch (Exception e) {
- throw new IllegalArgumentException(MessageFormat.format(
- Messages.getString("AbstractBaseGroup.isNotValidProfilerFile"), path //$NON-NLS-1$
- .lastSegment()));
+ throw new IllegalArgumentException(
+ MessageFormat
+ .format(
+ Messages
+ .getString("AbstractBaseGroup.isNotValidProfilerFile"), path //$NON-NLS-1$
+ .lastSegment()));
}
} else {
- throw new IllegalArgumentException(MessageFormat.format(
- Messages.getString("AbstractBaseGroup.profilerFileIsExisted"), path.lastSegment())); //$NON-NLS-1$
+ throw new IllegalArgumentException(
+ MessageFormat
+ .format(
+ Messages
+ .getString("AbstractBaseGroup.profilerFileIsExisted"), path.lastSegment())); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Update trace data file during tracing
+ *
+ * @param path of the profiler data file
+ * @param time of the trace run
+ * @param size of the trace data file
+ * @throws IllegalArgumentException
+ */
+ public void updateProfilerDataFile(IPath path, long time, long size)
+ throws IllegalArgumentException {
+ boolean exists = false;
+ for (ProfilerDataPlugins pdp : profilerDataFiles) {
+ if (pdp.getProfilerDataPath().equals(path)) {
+ pdp.updateTimeAndSize(time, size);
+ exists = true;
+ break;
+ }
+ }
+ if (!exists) {
+ profilerDataFiles.add(new ProfilerDataPlugins(path, null));
+
+ } else {
+ if (!timeAndSizeEnabled) {
+ throw new IllegalArgumentException(
+ MessageFormat
+ .format("Failed to update profiler data file", path.lastSegment())); //$NON-NLS-1$
+ }
+
}
}
@@ -195,7 +250,7 @@
for (File file : fileArray) {
try {
- addProfileDataFile(new Path(file.toString()));
+ addProfilerDataFile(new Path(file.toString()),0,0);
addedValidFile = true;
} catch (Exception e) {
// do nothing
@@ -203,14 +258,20 @@
}
} catch (Exception e) {
- throw new IllegalArgumentException(MessageFormat.format(
- Messages.getString("AbstractBaseGroup.failedToImportFromFolder"), path //$NON-NLS-1$
- .toOSString()));
+ throw new IllegalArgumentException(
+ MessageFormat
+ .format(
+ Messages
+ .getString("AbstractBaseGroup.failedToImportFromFolder"), path //$NON-NLS-1$
+ .toOSString()));
}
if (!addedValidFile) {
- throw new IllegalArgumentException(MessageFormat.format(
- Messages.getString("AbstractBaseGroup.notFoundProfilerDataFiles"), path //$NON-NLS-1$
- .toOSString()));
+ throw new IllegalArgumentException(
+ MessageFormat
+ .format(
+ Messages
+ .getString("AbstractBaseGroup.notFoundProfilerDataFiles"), path //$NON-NLS-1$
+ .toOSString()));
}
}
}
@@ -236,6 +297,23 @@
}
/**
+ * Remove ProfilerDataPlugins with given path
+ *
+ * @param path
+ * @return instance of the removed ProfilerDataPlugins
+ */
+ public ProfilerDataPlugins removeWithPath(IPath path) {
+
+ for (ProfilerDataPlugins pdp : profilerDataFiles) {
+ if (pdp.getProfilerDataPath().equals(path)) {
+ profilerDataFiles.remove(pdp);
+ return pdp;
+ }
+ }
+ return null;
+ }
+
+ /**
* Remove all item
*/
public void removeAll() {
@@ -272,23 +350,34 @@
*
* @param tableViewer
* instance of the TableViewer
+ * @param validatePage is need to be validate
*/
- public void refreshTable(TableViewer tableViewer) {
+ public void refreshTable(TableViewer tableViewer, boolean validatePage) {
Table table = tableViewer.getTable();
- List<IPath> pathList = new ArrayList<IPath>();
- for (ProfilerDataPlugins pdp : profilerDataFiles) {
- pathList.add(pdp.getProfilerDataPath());
+ if (timeAndSizeEnabled) {
+ tableViewer.setInput(profilerDataFiles);
+ } else {
+ List<IPath> pathList = new ArrayList<IPath>();
+ for (ProfilerDataPlugins pdp : profilerDataFiles) {
+ pathList.add(pdp.getProfilerDataPath());
+ }
+ tableViewer.setInput(pathList);
+
}
- tableViewer.setInput(pathList);
table.setSelection(0);
tableViewer.refresh();
- wizardSettings.validatePage();
+ if(validatePage){
+ wizardSettings.validatePage();
+ }
+
+
}
/**
* Get plugins list from given file
*
- * @param profilerPath profiler data file
+ * @param profilerPath
+ * profiler data file
* @return available plugins list from given file
* @throws IOException
*/
@@ -300,7 +389,7 @@
/**
* Get ProfilerDataPlugins by given profiler data file
*
- * @param path
+ * @param path
* @return instance of the ProfilerDataPlugins if found otherwise null is
* returned
*/
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/FileSelectionGroup.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/FileSelectionGroup.java Wed Jun 23 15:05:09 2010 +0300
@@ -42,6 +42,7 @@
import org.eclipse.swt.widgets.TableColumn;
import com.nokia.carbide.cpp.pi.PiPlugin;
+import com.nokia.carbide.cpp.pi.wizards.WizardsPlugin;
/**
* Provides content of the profile data file selection from file system group
@@ -49,6 +50,7 @@
public class FileSelectionGroup extends AbstractBaseGroup {
private TableViewer profileDataTable;
+ private PluginSelectionGroup pluginSelectionGroup;
/**
* Constructor
@@ -58,7 +60,7 @@
*/
public FileSelectionGroup(Composite parent,
INewPIWizardSettings wizardSettings) {
- super(parent, wizardSettings);
+ super(parent, wizardSettings, false);
}
/*
@@ -129,6 +131,7 @@
profileDataTable.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
if(profileDataTable.getTable().getSelectionCount() == 1){
+ pluginSelectionGroup.updateTraceIds(getSelectedItem());
wizardSettings.validatePage();
}
@@ -200,7 +203,7 @@
IPath folder = new Path(path).removeLastSegments(1);
for(String fileName: dialog.getFileNames()){
try {
- addProfileDataFile(folder.append(fileName));
+ addProfilerDataFile(folder.append(fileName),0,0);
} catch (IllegalArgumentException iae) {
IStatus status = new Status(Status.ERROR,
PiPlugin.PLUGIN_ID, iae.getMessage());
@@ -208,7 +211,7 @@
Messages.getString("FileSelectionGroup.performanceInvestigator"), null, status); //$NON-NLS-1$
}
}
- refreshTable(profileDataTable);
+ refreshTable(profileDataTable, true);
}
}
});
@@ -230,7 +233,7 @@
if (result != null) {
try {
addDirectory(new Path(result));
- refreshTable(profileDataTable);
+ refreshTable(profileDataTable, true);
} catch (IllegalArgumentException iae) {
IStatus status = new Status(Status.ERROR,
@@ -250,7 +253,7 @@
removeOneButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
removeSelectedItem(profileDataTable);
- refreshTable(profileDataTable);
+ refreshTable(profileDataTable, true);
}
});
@@ -263,10 +266,11 @@
removeAllButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
removeAll();
- refreshTable(profileDataTable);
+ refreshTable(profileDataTable, true);
}
});
+ pluginSelectionGroup = new PluginSelectionGroup(this,wizardSettings, false);
}
/*
@@ -277,4 +281,23 @@
public Table getTable() {
return profileDataTable.getTable();
}
+
+
+ @Override
+ public IStatus validateContent(NewPIWizard wizardPage) {
+ IStatus status = Status.OK_STATUS;
+ if(pluginSelectionGroup != null){
+ pluginSelectionGroup.updateTraceIds(getSelectedItem());
+ wizardPage.setProfilerDataFiles(getProfilerDataFiles());
+ }
+ int count = getProfilerDataFiles().size();
+ if( count > 1){
+ status = new Status(Status.WARNING, WizardsPlugin.PLUGIN_ID, Messages.getString("NewPIWizardPageInputTask.noteImportMayTakeSeveralMinutes")); //$NON-NLS-1$
+ }else if(count == 1){
+ status = new Status(Status.OK, WizardsPlugin.PLUGIN_ID,Messages.getString("NewPIWizardPageSampleFile.description")); //$NON-NLS-1$
+ }else{
+ status = new Status(Status.INFO, WizardsPlugin.PLUGIN_ID,Messages.getString("NewPIWizardPageSampleFile.description")); //$NON-NLS-1$
+ }
+ return status;
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.wizards.ui.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizard.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizard.java Wed Jun 23 15:05:09 2010 +0300
@@ -21,6 +21,7 @@
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -34,6 +35,7 @@
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
@@ -42,7 +44,11 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.IProgressService;
@@ -51,15 +57,26 @@
import com.nokia.carbide.cdt.builder.project.ISISBuilderInfo;
import com.nokia.carbide.cpp.internal.api.sdk.SymbianBuildContext;
import com.nokia.carbide.cpp.internal.pi.analyser.AnalyserDataProcessor;
+import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
+import com.nokia.carbide.cpp.internal.pi.model.GenericSampledTrace;
+import com.nokia.carbide.cpp.internal.pi.model.GenericTrace;
+import com.nokia.carbide.cpp.internal.pi.model.ParsedTraceData;
+import com.nokia.carbide.cpp.internal.pi.model.TraceDataRepository;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace;
import com.nokia.carbide.cpp.internal.pi.utils.PIUtilities;
+import com.nokia.carbide.cpp.internal.pi.wizards.model.SessionHandler;
+import com.nokia.carbide.cpp.internal.pi.wizards.model.TraceFile;
import com.nokia.carbide.cpp.internal.pi.wizards.ui.util.IPkgEntry;
import com.nokia.carbide.cpp.internal.pi.wizards.ui.util.RofsObySymbolPair;
+import com.nokia.carbide.cpp.internal.pi.wizards.ui.views.PIView;
+import com.nokia.carbide.cpp.pi.PiPlugin;
import com.nokia.carbide.cpp.pi.button.BupEventMapManager;
import com.nokia.carbide.cpp.pi.button.ButtonPlugin;
import com.nokia.carbide.cpp.pi.importer.SampleImporter;
import com.nokia.carbide.cpp.pi.util.GeneralMessages;
import com.nokia.carbide.cpp.pi.wizards.WizardsPlugin;
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
+import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
import com.nokia.carbide.cpp.ui.CarbideUIPlugin;
import com.nokia.carbide.cpp.ui.ICarbideSharedImages;
import com.nokia.cpp.internal.api.utils.core.Check;
@@ -224,7 +241,6 @@
if (container.startsWith("/")) //$NON-NLS-1$
container = container.substring(1, container.length());
sampleImporter.setProjectName(container);
- sampleImporter.setPiFileName(wizardSettings.piFileName);
if (wizardSettings.haveRomOnly || wizardSettings.haveAppRom) {
if (wizardSettings.romSdk != null && wizardSettings.romSdk.getEPOCROOT() != null) {
sampleImporter.setRomEpocroot(wizardSettings.romSdk.getEPOCROOT());
@@ -314,13 +330,16 @@
}
}
+ sampleImporter.setProfilerActivator(wizardSettings.profilerActivator);
if(profilerDataPlugins.size() <= 1){
for(ProfilerDataPlugins pdp : profilerDataPlugins){
sampleImporter.setDatFileName(pdp.getProfilerDataPath().toString());
// due to PI shortcomings (i.e. plugins that create pages have to come first)
// the plugins have to be sorted by trace id
+ sampleImporter.setPiFileName(""); //$NON-NLS-1$
sampleImporter.importSamples(false, PIUtilities.sortPlugins(pdp.getSelectedPlugins()), true, null, null);
+ logImportedFile(pdp);
break;
}
}
@@ -339,9 +358,11 @@
}
suffixTaskName = MessageFormat.format(Messages.getString("NewPIWizard.suffixTaskName"), i[0]++, count); //$NON-NLS-1$
sampleImporter.setDatFileName(pdp.getProfilerDataPath().toString());
+ sampleImporter.setPiFileName(""); //$NON-NLS-1$
sampleImporter.importSamples(false, PIUtilities
.sortPlugins(pdp.getSelectedPlugins()), false, suffixTaskName,
new SubProgressMonitor(progressMonitor, AnalyserDataProcessor.TOTAL_PROGRESS_COUNT));
+ logImportedFile(pdp);
}
}
@@ -352,7 +373,51 @@
GeneralMessages.showErrorMessage(e.getMessage());
}
}
- cleanTempPkgFile();
+ cleanTempPkgFile();
+ showPIViewer();
+ }
+
+ /**
+ * Log given imported file to show it on the PI view
+ *
+ * @param pdp instance of the ProfilerDataPlugins
+ */
+ private void logImportedFile(ProfilerDataPlugins pdp){
+ SampleImporter sampleImporter = SampleImporter.getInstance();
+ ISymbianSDK sdk = NewPIWizardSettings.getInstance().romSdk;
+ String sdkName = "";
+ if(sdk != null && (NewPIWizardSettings.getInstance().haveRomOnly || NewPIWizardSettings.getInstance().haveAppRom)){
+ sdkName = NewPIWizardSettings.getInstance().romSdk.getUniqueId();
+ }
+ long sampleTime = -1;
+
+ Iterator<ParsedTraceData> traces = TraceDataRepository.getInstance().getTraceCollectionIter(NpiInstanceRepository.getInstance().activeUid());
+ while(traces.hasNext()){
+ ParsedTraceData ptd = traces.next();
+ GenericTrace gt = ptd.traceData;
+ if(gt instanceof GenericSampledTrace){
+ GenericSampledTrace gst = (GenericSampledTrace)gt;
+ long lastSampleTime = gst.getLastSampleTime();
+ if(sampleTime < lastSampleTime){
+ sampleTime = lastSampleTime;
+ }
+ }
+ }
+ List<ITrace> plugins = pdp.getSelectedPlugins();
+ int[] pluginIds = new int[plugins.size()];
+ int i=0;
+ for(ITrace plugin : plugins){
+ pluginIds[i++] = plugin.getTraceId();
+ }
+ IPath filePath = sampleImporter.getPiFile().getFullPath();
+ SessionHandler.getInstance().addTraceFile(new TraceFile(filePath, sampleImporter.getProjectName(), sdkName, filePath.toFile().length(), sampleTime, pluginIds));
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ showPIViewer();
+
+ }
+ });
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
@@ -427,4 +492,65 @@
return false;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#performCancel()
+ */
+ @Override
+ public boolean performCancel() {
+ if(PiPlugin.isTraceProviderAvailable() && PiPlugin.getTraceProvider().isListening()){
+ showInformationDialog();
+ return false;
+ }
+ pageInput.handleTemporaryProfilerDataFiles(false);
+ return super.performCancel();
+ }
+
+ /**
+ * Show information dialog about to stop tracing in order to go back or
+ * close the wizard page
+ */
+ public void showInformationDialog(){
+ MessageDialog.openInformation(getShell(), Messages.getString("NewPIWizard.informationDialogTitle"), Messages.getString("NewPIWizard.informationDialogMessage")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Show PI view
+ */
+ private void showPIViewer(){
+ try {
+ IWorkbenchWindow workbenchWindow = PiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
+ if (workbenchWindow == null)
+ return;
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ // Checking if view is already open
+ IViewReference[] viewRefs = page.getViewReferences();
+ for (int i = 0; i < viewRefs.length; i++) {
+ IViewReference reference = viewRefs[i];
+ String id = reference.getId();
+ if(PIView.ID.equalsIgnoreCase(id)){
+ // Found, restoring the view
+ IViewPart viewPart = reference.getView(true);
+ page.activate(viewPart);
+ ((PIView)viewPart).updateView();
+ return;
+ }
+ }
+
+ // View was not found, opening it up as a new view.
+ IViewPart viewPart = page.showView(PIView.ID);
+ ((PIView)viewPart).updateView();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#dispose()
+ */
+ @Override
+ public void dispose() {
+ showPIViewer();
+ super.dispose();
+ }
+
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageBupMapTask.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageBupMapTask.java Wed Jun 23 15:05:09 2010 +0300
@@ -29,6 +29,7 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
@@ -101,6 +102,18 @@
validatePage();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#performHelp()
+ */
+ @Override
+ public void performHelp() {
+ WizardDialog wizardDialog = (WizardDialog)getContainer();
+ if(wizardDialog.buttonBar != null){
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(wizardDialog.buttonBar,
+ CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_BUP_MAP);
+ }
+ }
/* (non-Javadoc)
* @see com.nokia.carbide.cpp.internal.pi.wizards.ui.INewPIWizardSettings#setupPageFromFromNewPIWizardSettings()
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageConfigSelectorTask.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageConfigSelectorTask.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,7 +17,9 @@
package com.nokia.carbide.cpp.internal.pi.wizards.ui;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
@@ -40,43 +42,43 @@
{
// control
- private Composite composite = null;
- private Group optionGroup = null;
- private Composite appComposite = null;
- private Composite appLabelComposite = null;
- private Button buttonApp = null;
- private Label labelAppTitle = null;
- private Label labelApp2 = null;
- private Composite romAppComposite = null;
- private Composite romAppLabelComposite = null;
- private Button buttonRomApp = null;
- private Label labelRomAppTitle = null;
- private Label labelRomApp2 = null;
- private Label labelRomApp3 = null;
- private Composite romComposite = null;
- private Composite romLabelComposite = null;
- private Button buttonRom = null;
- private Label labelRomTitle = null;
- private Label labelRom2 = null;
- private Composite noneComposite = null;
- private Composite noneLabelComposite = null;
- private Button buttonNone = null;
- private Label labelNoneTitle = null;
- private Label labelNone2 = null;
- private Label labelNone3 = null;
+ private transient Composite composite = null;
+ private transient Group optionGroup = null;
+ private transient Composite appComposite = null;
+ private transient Composite appLabelComposite = null;
+ private transient Button buttonApp = null;
+ private transient Label labelAppTitle = null;
+ private transient Label labelApp2 = null;
+ private transient Composite romAppComposite = null;
+ private transient Composite romAppLabelComposite = null;
+ private transient Button buttonRomApp = null;
+ private transient Label labelRomAppTitle = null;
+ private transient Label labelRomApp2 = null;
+ private transient Label labelRomApp3 = null;
+ private transient Composite romComposite = null;
+ private transient Composite romLabelComposite = null;
+ private transient Button buttonRom = null;
+ private transient Label labelRomTitle = null;
+ private transient Label labelRom2 = null;
+ private transient Composite noneComposite = null;
+ private transient Composite noneLabelComposite = null;
+ private transient Button buttonNone = null;
+ private transient Label labelNoneTitle = null;
+ private transient Label labelNone2 = null;
+ private transient Label labelNone3 = null;
@SuppressWarnings("unused") //$NON-NLS-1$
- private Group customTraceGroup = null;
+ private transient Group customTraceGroup = null;
@SuppressWarnings("unused") //$NON-NLS-1$
- private Button buttonCustomTrace = null;
+ private transient Button buttonCustomTrace = null;
@SuppressWarnings("unused") //$NON-NLS-1$
- private Label labelCustomTrace = null;
+ private transient Label labelCustomTrace = null;
- private ICarbideSharedImages carbideImages = CarbideUIPlugin.getSharedImages();
- private Image phonensisImage = carbideImages.getImage(ICarbideSharedImages.IMG_PI_IMPORT_ROM_AND_APP_100_42);
- private Image phoneImage = carbideImages.getImage(ICarbideSharedImages.IMG_PI_IMPORT_ROM_42_42);
- private Image sisImage = carbideImages.getImage(ICarbideSharedImages.IMG_PI_IMPORT_APP_42_42);
- private Image noneImage = carbideImages.getImage(ICarbideSharedImages.IMG_PI_IMPORT_NONE_100_42);
- private Image cusTraceImage = carbideImages.getImage(ICarbideSharedImages.IMG_CUSTOM_TRACE_BADGE_24_24);
+ private transient final ICarbideSharedImages carbideImages = CarbideUIPlugin.getSharedImages();
+ private transient final Image phonensisImage = carbideImages.getImage(ICarbideSharedImages.IMG_PI_IMPORT_ROM_AND_APP_100_42);
+ private transient final Image phoneImage = carbideImages.getImage(ICarbideSharedImages.IMG_PI_IMPORT_ROM_42_42);
+ private transient final Image sisImage = carbideImages.getImage(ICarbideSharedImages.IMG_PI_IMPORT_APP_42_42);
+ private transient final Image noneImage = carbideImages.getImage(ICarbideSharedImages.IMG_PI_IMPORT_NONE_100_42);
+ private transient final Image cusTraceImage = carbideImages.getImage(ICarbideSharedImages.IMG_CUSTOM_TRACE_BADGE_24_24);
protected NewPIWizardPageConfigSelectorTask() {
super(Messages.getString("NewPIWizardPageConfigSelectorTask.title")); //$NON-NLS-1$
@@ -84,13 +86,10 @@
setDescription(Messages.getString("NewPIWizardPageConfigSelectorTask.description")); //$NON-NLS-1$
}
- SelectionListener buttonListener = new SelectionListener () {
+ private final transient SelectionListener buttonListener = new SelectionAdapter () {
// handle all buttons including radio behavior among toggle
-
- public void widgetDefaultSelected(SelectionEvent arg0) {
- }
-
- public void widgetSelected(SelectionEvent arg0) {
+
+ public void widgetSelected(final SelectionEvent arg0) {
buttonApp.setSelection(false);
buttonRomApp.setSelection(false);
buttonRom.setSelection(false);
@@ -114,14 +113,14 @@
}
};
- public void createControl(Composite parent) {
+ public void createControl(final Composite parent) {
super.createControl(parent);
- GridLayout gridLayout1 = new GridLayout();
+ final GridLayout gridLayout1 = new GridLayout();
gridLayout1.numColumns = 1;
composite = new Composite (parent, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
composite.setLayout(gridLayout1);
- GridLayout gridLayout2 = new GridLayout();
+ final GridLayout gridLayout2 = new GridLayout();
gridLayout2.numColumns = 1;
optionGroup = new Group(composite, SWT.NONE);
optionGroup.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, true));
@@ -141,7 +140,7 @@
createNoneComposite();
// createCustomComposite();
- GridData buttonWidthGridData = new GridData();
+ final GridData buttonWidthGridData = new GridData();
buttonWidthGridData.widthHint = Math.max(Math.max(Math.max(phonensisImage.getBounds().width, phoneImage.getBounds().width), sisImage.getBounds().width), noneImage.getBounds().width) + 30;
buttonWidthGridData.heightHint = Math.max(Math.max(Math.max(phonensisImage.getBounds().height, phoneImage.getBounds().height), sisImage.getBounds().height), noneImage.getBounds().height) + 30;
buttonRomApp.setLayoutData(buttonWidthGridData);
@@ -155,8 +154,21 @@
validatePage();
}
- void createAppComposite() {
- GridLayout gridLayout1 = new GridLayout();
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#performHelp()
+ */
+ @Override
+ public void performHelp() {
+ final WizardDialog wizardDialog = (WizardDialog)getContainer();
+ if(wizardDialog.buttonBar != null){
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(wizardDialog.buttonBar,
+ CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_CONFIG_SELECTOR);
+ }
+
+ }
+
+ private void createAppComposite() {
+ final GridLayout gridLayout1 = new GridLayout();
gridLayout1.numColumns = 2;
appComposite = new Composite (optionGroup, SWT.NONE);
appComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, true));
@@ -164,7 +176,7 @@
buttonApp = new Button(appComposite, SWT.TOGGLE);
buttonApp.setImage(sisImage);
buttonApp.addSelectionListener(buttonListener);
- GridLayout gridLayout2 = new GridLayout();
+ final GridLayout gridLayout2 = new GridLayout();
gridLayout2.numColumns = 1;
appLabelComposite = new Composite (appComposite, SWT.NONE);
appLabelComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, true));
@@ -173,8 +185,8 @@
labelApp2.setText(Messages.getString("NewPIWizardPageConfigSelectorTask.labelApp2")); //$NON-NLS-1$
}
- void createRomAppComposite() {
- GridLayout gridLayout1 = new GridLayout();
+ private void createRomAppComposite() {
+ final GridLayout gridLayout1 = new GridLayout();
gridLayout1.numColumns = 2;
romAppComposite = new Composite (optionGroup, SWT.NONE);
romAppComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, true));
@@ -182,7 +194,7 @@
buttonRomApp = new Button(romAppComposite, SWT.TOGGLE);
buttonRomApp.setImage(phonensisImage);
buttonRomApp.addSelectionListener(buttonListener);
- GridLayout gridLayout2 = new GridLayout();
+ final GridLayout gridLayout2 = new GridLayout();
gridLayout2.numColumns = 1;
romAppLabelComposite = new Composite (romAppComposite, SWT.NONE);
romAppLabelComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, true));
@@ -193,8 +205,8 @@
labelRomApp3.setText(Messages.getString("NewPIWizardPageConfigSelectorTask.labelRomApp3")); //$NON-NLS-1$
}
- void createRomComposite() {
- GridLayout gridLayout1 = new GridLayout();
+ private void createRomComposite() {
+ final GridLayout gridLayout1 = new GridLayout();
gridLayout1.numColumns = 2;
romComposite = new Composite (optionGroup, SWT.NONE);
romComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, true));
@@ -202,7 +214,7 @@
buttonRom = new Button(romComposite, SWT.TOGGLE);
buttonRom.setImage(phoneImage);
buttonRom.addSelectionListener(buttonListener);
- GridLayout gridLayout2 = new GridLayout();
+ final GridLayout gridLayout2 = new GridLayout();
gridLayout2.numColumns = 1;
romLabelComposite = new Composite (romComposite, SWT.NONE);
romLabelComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, true));
@@ -211,8 +223,8 @@
labelRom2.setText(Messages.getString("NewPIWizardPageConfigSelectorTask.labelRom2")); //$NON-NLS-1$
}
- void createNoneComposite() {
- GridLayout gridLayout1 = new GridLayout();
+ private void createNoneComposite() {
+ final GridLayout gridLayout1 = new GridLayout();
gridLayout1.numColumns = 2;
noneComposite = new Composite (optionGroup, SWT.NONE);
noneComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, true));
@@ -220,7 +232,7 @@
buttonNone = new Button(noneComposite, SWT.TOGGLE);
buttonNone.setImage(noneImage);
buttonNone.addSelectionListener(buttonListener);
- GridLayout gridLayout2 = new GridLayout();
+ final GridLayout gridLayout2 = new GridLayout();
gridLayout2.numColumns = 1;
noneLabelComposite = new Composite (noneComposite, SWT.NONE);
noneLabelComposite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, true));
@@ -231,19 +243,6 @@
labelNone3.setText(Messages.getString("NewPIWizardPageConfigSelectorTask.labelNone3")); //$NON-NLS-1$
}
- void createCustomComposite() {
- GridLayout gridLayout3 = new GridLayout();
- gridLayout3.numColumns = 2;
- customTraceGroup = new Group(composite, SWT.NONE);
- customTraceGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- customTraceGroup.setLayout(gridLayout3);
- buttonCustomTrace = new Button(customTraceGroup, SWT.CHECK);
- buttonCustomTrace.setImage(cusTraceImage);
- buttonCustomTrace.addSelectionListener(buttonListener);
- labelCustomTrace = new Label(customTraceGroup, SWT.WRAP);
- labelCustomTrace.setText(Messages.getString("NewPIWizardPageConfigSelectorTask.labelCustomTrace")); //$NON-NLS-1$
- }
-
public void validatePage() {
if (buttonRomApp.getSelection() == false &&
buttonApp.getSelection() == false &&
@@ -259,19 +258,19 @@
}
public void setupPageFromFromNewPIWizardSettings() {
- if (NewPIWizardSettings.getInstance().haveAppRom == true) {
+ if (NewPIWizardSettings.getInstance().haveAppRom) {
// buttonApp.setSelection(false);
// buttonRomApp.setSelection(true);
// buttonRom.setSelection(false);
// set focus, and block them
buttonRomApp.setFocus();
- } else if (NewPIWizardSettings.getInstance().haveAppOnly == true) {
+ } else if (NewPIWizardSettings.getInstance().haveAppOnly) {
// buttonApp.setSelection(true);
// buttonRomApp.setSelection(false);
// buttonRom.setSelection(false);
// set focus, and block them
buttonApp.setFocus();
- } else if (NewPIWizardSettings.getInstance().haveRomOnly == true) {
+ } else if (NewPIWizardSettings.getInstance().haveRomOnly) {
// buttonApp.setSelection(false);
// buttonRomApp.setSelection(false);
// buttonRom.setSelection(true);
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageCustomTask.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageCustomTask.java Wed Jun 23 15:05:09 2010 +0300
@@ -19,6 +19,7 @@
import java.io.File;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -170,6 +171,19 @@
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_CUSTOM);
}
+/* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#performHelp()
+ */
+@Override
+public void performHelp() {
+ WizardDialog wizardDialog = (WizardDialog)getContainer();
+ if(wizardDialog.buttonBar != null){
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(wizardDialog.buttonBar,
+ CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_CUSTOM);
+ }
+
+}
+
public void validatePage() {
if (sampleFileText.getText().length() == 0) {
updateStatus(Messages.getString("NewPIWizardCustomTask.dat.file.name.must.be.specified")); //$NON-NLS-1$
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageInputTask.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageInputTask.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,22 +17,39 @@
package com.nokia.carbide.cpp.internal.pi.wizards.ui;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import com.nokia.carbide.cpp.internal.pi.wizards.ui.util.CarbidePiWizardHelpIds;
+import com.nokia.carbide.cpp.pi.PiPlugin;
public class NewPIWizardPageInputTask extends NewPIWizardPage implements
INewPIWizardSettings {
private FileSelectionGroup fileSelectionGroup;
- private TraceSelectionGroup traceSelectionGroup;
+ private ProfilerActivatorGroup profilerActivatorGroup;
+ private Button fileRadioButton;
+ private Button deviceRadioButton;
+
+ /**
+ * TraceViewers ID com.nokia.traceviewer.view.TraceViewerView
+ */
+ private static final String TRACE_VIEWER_VIEW_ID = "com.nokia.traceviewer.view.TraceViewerView"; //$NON-NLS-1$
+
protected NewPIWizardPageInputTask(final NewPIWizard wizard) {
super(Messages.getString("NewPIWizardPageSampleFile.title")); //$NON-NLS-1$
@@ -48,15 +65,31 @@
container.setLayout(layout);
layout.numColumns = 1;
- //createRadioButtonGroup(container); // not implemented yet
- fileSelectionGroup = new FileSelectionGroup(container, this);
- fileSelectionGroup.setVisible(true);
-
- traceSelectionGroup = new TraceSelectionGroup(container,this);
+ createRadioButtonGroup(container);
+ fileSelectionGroup = new FileSelectionGroup(container, this);
+ if(PiPlugin.isTraceProviderAvailable()){
+ profilerActivatorGroup = new ProfilerActivatorGroup(container, this, this, getContainer());
+ fileSelectionGroup.setVisible(profilerActivatorGroup);
+ }
+
setControl(container);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_INPUT);
}
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#performHelp()
+ */
+ @Override
+ public void performHelp() {
+ WizardDialog wizardDialog = (WizardDialog)getContainer();
+ if(wizardDialog.buttonBar != null){
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(wizardDialog.buttonBar,
+ CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_INPUT);
+ }
+
+ }
private void createRadioButtonGroup(Composite parent) {
// Radio button group
@@ -69,60 +102,70 @@
radioButtonGridData.horizontalSpan = 2;
// File radio button
- final Button fileRadioButton = new Button(radioButtonGroup, SWT.RADIO);
+ fileRadioButton = new Button(radioButtonGroup, SWT.RADIO);
fileRadioButton.setText(Messages.getString("NewPIWizardPageInputTask.fromFileSystem")); //$NON-NLS-1$
fileRadioButton.setLayoutData(radioButtonGridData);
- fileRadioButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- if (fileRadioButton.getSelection()) {
- fileSelectionGroup.setVisible(true);
+ fileRadioButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if(e.widget == fileRadioButton){
+ if(!fileSelectionGroup.isVisible()){
+ setErrorMessage(null);
+ NewPIWizardSettings.getInstance().profilerActivator = false;
+ fileSelectionGroup.setVisible(profilerActivatorGroup);
+ }
}
-
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
}
});
fileRadioButton.setSelection(true);
// From Device via TraceViewer radio button
- final Button deviceRadioButton = new Button(radioButtonGroup, SWT.RADIO);
+ deviceRadioButton = new Button(radioButtonGroup, SWT.RADIO);
deviceRadioButton
.setText(Messages.getString("NewPIWizardPageInputTask.fromDevice")); //$NON-NLS-1$
deviceRadioButton.setLayoutData(radioButtonGridData);
- deviceRadioButton.addSelectionListener(new SelectionListener() {
+ deviceRadioButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (deviceRadioButton.getSelection()) {
+ public void widgetSelected(SelectionEvent e) {
+ if(e.widget == deviceRadioButton){
+ if(!profilerActivatorGroup.isVisible()){
+ setErrorMessage(null);
+
+ NewPIWizardSettings.getInstance().profilerActivator = true;
+ profilerActivatorGroup.setVisible(fileSelectionGroup);
+ }
}
}
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
});
deviceRadioButton.setSelection(false);
-
- // not implemented yet
- deviceRadioButton.setEnabled(false);
+
+ // In case trace plugin is not available, disabling profiler activator part
+ if(!PiPlugin.isTraceProviderAvailable()){
+ deviceRadioButton.setEnabled(false);
+ }
}
- public void validatePage() {
- if(traceSelectionGroup != null){
- traceSelectionGroup.updateTraceIds(fileSelectionGroup.getSelectedItem());
- ((NewPIWizard)getWizard()).setProfilerDataFiles(fileSelectionGroup.getProfilerDataFiles());
- }
- if(fileSelectionGroup.getProfilerDataFiles().size() > 1){
- setMessage(Messages.getString("NewPIWizardPageInputTask.noteImportMayTakeSeveralMinutes")); //$NON-NLS-1$
+ public void validatePage(){
+ IStatus status = null;
+
+ if(fileRadioButton.getSelection()){
+ status = fileSelectionGroup.validateContent((NewPIWizard)getWizard());
}else{
- setMessage(Messages.getString("NewPIWizardPageSampleFile.description"));
+ status = profilerActivatorGroup.validateContent((NewPIWizard)getWizard());
+ }
+ setErrorMessage(null);
+ if(status.getSeverity() == Status.OK){
+ updateStatus(null);
+ }else if(status.getSeverity() == Status.INFO){
+ setMessage(status.getMessage());
+ setPageComplete(false);
+ }else if(status.getSeverity() == Status.WARNING){
+ setMessage(status.getMessage());
+ setPageComplete(true);
+ }else{
+ updateStatus(status.getMessage());
}
- if(fileSelectionGroup.getProfilerDataFiles().isEmpty()){
- setPageComplete(false);
- } else {
- setPageComplete(true);
- updateStatus(null);
- }
+
+
}
@@ -135,6 +178,7 @@
public void setVisible(boolean visable) {
super.setVisible(visable);
if (visable) {
+ showTraceViewer();
validatePage();
}
}
@@ -142,4 +186,83 @@
public void setupPageFromFromNewPIWizardSettings() {
// do nothing
}
+
+ /**
+ * Shows trace viewer plugin's view
+ */
+ public void showTraceViewer() {
+ try {
+ IWorkbenchWindow workbenchWindow = PiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
+ if (workbenchWindow == null)
+ return;
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ // Checking if view is already open
+ IViewReference[] viewRefs = page.getViewReferences();
+ for (int i = 0; i < viewRefs.length; i++) {
+ IViewReference reference = viewRefs[i];
+ String id = reference.getId();
+ if(id.equalsIgnoreCase(TRACE_VIEWER_VIEW_ID)){
+ // Found, restoring the view
+ IViewPart viewPart = reference.getView(true);
+ page.activate(viewPart);
+ return;
+ }
+ }
+
+ // View was not found, opening it up as a new view.
+ page.showView(TRACE_VIEWER_VIEW_ID);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.WizardPage#getNextPage()
+ */
+ @Override
+ public IWizardPage getNextPage() {
+ if(PiPlugin.isTraceProviderAvailable() && PiPlugin.getTraceProvider().isListening()){
+ ((NewPIWizard)getWizard()).showInformationDialog();
+ return this;
+ }
+ return super.getNextPage();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.WizardPage#getPreviousPage()
+ */
+ @Override
+ public IWizardPage getPreviousPage() {
+ if(PiPlugin.isTraceProviderAvailable() && PiPlugin.getTraceProvider().isListening()){
+ ((NewPIWizard)getWizard()).showInformationDialog();
+ return this;
+ }
+ return super.getPreviousPage();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Widget#dispose()
+ */
+ @Override
+ public void dispose() {
+ if(!getWizard().canFinish()){
+ handleTemporaryProfilerDataFiles(false);
+ }else if(!NewPIWizardSettings.getInstance().profilerActivator){
+ handleTemporaryProfilerDataFiles(true);
+ }
+
+
+ super.dispose();
+ }
+
+ public void setButtonGroupEnabled(boolean enabled){
+ deviceRadioButton.setEnabled(enabled);
+ fileRadioButton.setEnabled(enabled);
+ }
+
+ public void handleTemporaryProfilerDataFiles(boolean forceRemove){
+ if(PiPlugin.isTraceProviderAvailable()){
+ profilerActivatorGroup.handleTemporaryProfilerDataFiles(forceRemove);
+ }
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageOutputTask.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageOutputTask.java Wed Jun 23 15:05:09 2010 +0300
@@ -149,6 +149,19 @@
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_OUTPUT);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#performHelp()
+ */
+ @Override
+ public void performHelp() {
+ WizardDialog wizardDialog = (WizardDialog)getContainer();
+ if(wizardDialog.buttonBar != null){
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(wizardDialog.buttonBar,
+ CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_OUTPUT);
+ }
+
+ }
+
/**
* This method initializes projectComposite
*
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPagePkgListTask.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPagePkgListTask.java Wed Jun 23 15:05:09 2010 +0300
@@ -27,6 +27,7 @@
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -85,6 +86,18 @@
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_PKG_LIST);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#performHelp()
+ */
+ @Override
+ public void performHelp() {
+ WizardDialog wizardDialog = (WizardDialog)getContainer();
+ if(wizardDialog.buttonBar != null){
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(wizardDialog.buttonBar,
+ CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_PKG_LIST);
+ }
+ }
+
/**
* This method initializes filelistComposite
*
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageRomSdkSubTask.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageRomSdkSubTask.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,6 +17,7 @@
package com.nokia.carbide.cpp.internal.pi.wizards.ui;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.PlatformUI;
@@ -40,4 +41,17 @@
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_ROM_SDK);
setControl(composite);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#performHelp()
+ */
+ @Override
+ public void performHelp() {
+ WizardDialog wizardDialog = (WizardDialog)getContainer();
+ if(wizardDialog.buttonBar != null){
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(wizardDialog.buttonBar,
+ CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_ROM_SDK);
+ }
+
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageRomSubTask.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardPageRomSubTask.java Wed Jun 23 15:05:09 2010 +0300
@@ -22,6 +22,7 @@
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -244,6 +245,19 @@
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_ROM);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#performHelp()
+ */
+ @Override
+ public void performHelp() {
+ WizardDialog wizardDialog = (WizardDialog)getContainer();
+ if(wizardDialog.buttonBar != null){
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(wizardDialog.buttonBar,
+ CarbidePiWizardHelpIds.PI_IMPORT_WIZARD_ROM);
+ }
+
+ }
+
public void createSymbolControl() {
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardSettings.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/NewPIWizardSettings.java Wed Jun 23 15:05:09 2010 +0300
@@ -41,7 +41,7 @@
* Handles all import wizard's persist data
*/
-public class NewPIWizardSettings {
+public final class NewPIWizardSettings {
static NewPIWizardSettings instance = null;
static final int COMBO_MAX_ITEM_VALUES = 5;
@@ -74,7 +74,8 @@
static final String OUTPUT_NPI_KEY = "piFileName"; //$NON-NLS-1$
static final String KEY_PROFILE_KEY = "keyProfile"; //$NON-NLS-1$
static final String SAMPLEFILENAMES_KEY = "sampleFileName"; //$NON-NLS-1$
-
+ private static final String DEFAULT_TRACE_PLUGINS = "defaultTracePlugins"; //$NON-NLS-1$
+
boolean haveAppOnly = false;
boolean haveRomOnly = false;
boolean haveAppRom = false;
@@ -93,6 +94,7 @@
boolean custNameBased;
String custSeparator;
IContainer outputContainer;
+ boolean profilerActivator;
// end version 2
// start version 3
String piFileName;
@@ -104,6 +106,7 @@
long sampleFileNameModifiedNanoTime; // timestamp java.lang.System.nanoTime()
long piFileNameModifiedNanoTime; // timestamp java.lang.System.nanoTime()
// end internal states not saved
+ public int[] defaultPlugins;
public void clear() {
haveAppOnly = false;
@@ -128,6 +131,8 @@
keyMapProfile = null;
sampleFileNameModifiedNanoTime = 0;
piFileNameModifiedNanoTime = 0;
+ profilerActivator = false;
+ defaultPlugins = null;
}
private NewPIWizardSettings() {
@@ -201,6 +206,12 @@
dialogSettings.put(OUTPUT_PROJECT_KEY, outProject);
dialogSettings.put(OUTPUT_NPI_KEY, piFileName);
dialogSettings.put(KEY_PROFILE_KEY, keyMapProfile != null ? keyMapProfile.toString() : ""); //$NON-NLS-1$
+
+ String[] plugins = convertIntegerArrayToStringArray(defaultPlugins);
+ if(plugins != null){
+ dialogSettings.put(DEFAULT_TRACE_PLUGINS, plugins);
+ }
+
// newer members go here
} catch (Exception e) {
e.printStackTrace();
@@ -327,9 +338,38 @@
keyMapProfile = profile;
}
}
+
+ String[] plugins = dialogSettings.getArray(DEFAULT_TRACE_PLUGINS);
+ if(plugins != null){
+ defaultPlugins = convertStringArrayToIntegerArray(plugins);
+
+ }
+
} // if (dialogSettings.getInt(IMPORTER_SETTING_VERSION) == CURRENT_VERSION)
} catch (Exception e) {
e.printStackTrace();
}
}
+
+ private int[] convertStringArrayToIntegerArray(String[] strings){
+ if(strings == null){
+ return null;
+ }
+ int[] integers = new int[strings.length];
+ for(int i=0;i<strings.length;i++){
+ integers[i] = Integer.valueOf(strings[i]);
+ }
+ return integers;
+ }
+
+ private String[] convertIntegerArrayToStringArray(int[] integers){
+ if(integers == null){
+ return null;
+ }
+ String[] strings = new String[integers.length];
+ for(int i=0;i<integers.length;i++){
+ strings[i] = String.valueOf(integers[i]);
+ }
+ return strings;
+ }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/PluginSelectionGroup.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,356 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.carbide.cpp.internal.pi.wizards.ui;
+
+import java.text.MessageFormat;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.layout.TableColumnLayout;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.window.ToolTip;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+
+import com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace;
+
+public class PluginSelectionGroup extends Composite {
+
+ private CheckboxTableViewer viewerTraceSelection;
+ private ProfilerDataPlugins profilerDataPlugins;
+ private Label tableTitleLabel;
+ private boolean profilerActivator;
+ private int[] defaultPlugins;
+
+ /**
+ * Constructor
+ *
+ * @param parent
+ * instance of the parent composite
+ * @param wizardSettings
+ * instance of the INewPIWizardSettings
+ */
+ public PluginSelectionGroup(Composite parent,
+ INewPIWizardSettings wizardSettings, boolean profilerActivator) {
+ super(parent, SWT.NONE);
+ this.profilerActivator = profilerActivator;
+ if(profilerActivator){
+ this.defaultPlugins = NewPIWizardSettings.getInstance().defaultPlugins;
+ }
+
+ createContent();
+ }
+
+
+ @Override
+ protected void checkSubclass() {
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.carbide.cpp.internal.pi.wizards.ui.AbstractBaseGroup#createContent
+ * ()
+ */
+ public void createContent() {
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 1;
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+
+ this.setLayout(gridLayout);
+
+ this.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ tableTitleLabel = new Label(this, SWT.NONE);
+ final Composite tablePanel = new Composite(this, SWT.NONE);
+ final GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ tablePanel.setLayout(gridLayout);
+ tablePanel.setLayoutData(layoutData);
+ if(profilerActivator){
+ tableTitleLabel.setText(Messages.getString("TraceSelectionGroup.profilerActivatorTitle")); //$NON-NLS-1$
+ }else{
+ tableTitleLabel.setText(Messages.getString("TraceSelectionGroup.groupTitle")); //$NON-NLS-1$
+ }
+ viewerTraceSelection = CheckboxTableViewer.newCheckList(tablePanel,
+ SWT.BORDER | SWT.FULL_SELECTION);
+ viewerTraceSelection
+ .setContentProvider(new IStructuredContentProvider() {
+
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof List<?>) {
+ return ((List<?>) inputElement).toArray();
+ }
+ return new Object[0];
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {
+ }
+
+ });
+ viewerTraceSelection.setSorter(new ViewerSorter() {
+
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ if (profilerDataPlugins == null) {
+ return 0;
+ }
+ ITrace trace1 = (ITrace) e1;
+ ITrace trace2 = (ITrace) e2;
+ int returnCode = 0;
+ if (trace1.isMandatory() == true
+ && trace2.isMandatory() == true) {
+ returnCode = trace1.getTraceTitle().compareTo(
+ trace2.getTraceTitle());
+ } else if (trace1.isMandatory() == true
+ && trace2.isMandatory() == false) {
+ returnCode = -1;
+ } else if (trace1.isMandatory() == false
+ && trace2.isMandatory() == true) {
+ returnCode = 1;
+ } else {
+ returnCode = trace1.getTraceTitle().compareTo(
+ trace2.getTraceTitle());
+ }
+ return returnCode;
+ }
+
+ });
+
+ Table table = viewerTraceSelection.getTable();
+ table.setLinesVisible(true);
+ addActions();
+
+ ColumnViewerToolTipSupport.enableFor(viewerTraceSelection,
+ ToolTip.NO_RECREATE);
+
+ TableViewerColumn column = new TableViewerColumn(viewerTraceSelection,
+ SWT.NONE);
+ column.setLabelProvider(new ColumnLabelProvider() {
+ @Override
+ public String getText(final Object element) {
+ if (element instanceof ITrace) {
+ return ((ITrace) element).getTraceTitle();
+ }
+ return element.toString();
+ }
+
+ @Override
+ public String getToolTipText(Object element) {
+ StringBuilder sb = new StringBuilder(((ITrace) element)
+ .getTraceDescription());
+ if (((ITrace) element).getTraceId() == 1) {
+ sb.append(Messages.getString("TraceSelectionGroup.mandatory")); //$NON-NLS-1$
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public Color getForeground(Object element) {
+ if (((ITrace) element).getTraceId() == 1) {
+ return Display.getCurrent().getSystemColor(
+ SWT.COLOR_DARK_GRAY);
+ }
+ return null;
+ }
+
+ @Override
+ public Point getToolTipShift(Object object) {
+ return new Point(5, 5);
+ }
+
+ @Override
+ public int getToolTipTimeDisplayed(Object object) {
+ return 5000;
+ }
+ });
+
+ if(profilerActivator){
+ column.getColumn().setText(Messages.getString("TraceSelectionGroup.profilerActivatorTableColumn")); //$NON-NLS-1$
+ }else{
+ column.getColumn().setText(Messages.getString("TraceSelectionGroup.piView")); //$NON-NLS-1$
+ }
+
+
+ TableColumnLayout tableColumnLayout = new TableColumnLayout();
+ tablePanel.setLayout(tableColumnLayout);
+ tableColumnLayout.setColumnData(column.getColumn(),
+ new ColumnWeightData(1));// column weight 1 to fill the whole
+ // table width
+
+ viewerTraceSelection.setAllChecked(true);
+ viewerTraceSelection.addCheckStateListener(new ICheckStateListener() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged
+ * (org.eclipse.jface.viewers.CheckStateChangedEvent)
+ */
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ if (event.getChecked() == false
+ && viewerTraceSelection.getGrayed(event.getElement())) {
+ // mandatory view; don't allow to deselect it
+ viewerTraceSelection.setChecked(event.getElement(), true);
+ } else {
+ ITrace plugin = (ITrace) event.getElement();
+ profilerDataPlugins.setChecked(plugin, event.getChecked());
+ }
+ }
+ });
+ }
+
+ /**
+ * Update group's title
+ *
+ * @param fileName for the group title
+ */
+ private void updateTitle(String fileName){
+ if(!profilerActivator){
+ if(fileName == null){
+ tableTitleLabel.setText(Messages.getString("TraceSelectionGroup.groupTitle")); //$NON-NLS-1$
+ }else{
+ tableTitleLabel.setText(MessageFormat.format(Messages.getString("TraceSelectionGroup.groupTitleFor"), fileName)); //$NON-NLS-1$
+ }
+ this.layout();
+ }
+ }
+
+ /**
+ * Add actions
+ */
+ private void addActions() {
+ final MenuManager mgr = new MenuManager();
+ Action checkAllAction = new Action(Messages.getString("TraceSelectionGroup.actionCheckAll")) { //$NON-NLS-1$
+ @Override
+ public void run() {
+ if (profilerDataPlugins != null) {
+ profilerDataPlugins.checkAll();
+ viewerTraceSelection.setAllChecked(true);
+ }
+ }
+ };
+ checkAllAction.setEnabled(true);
+
+ Action uncheckAllAction = new Action(Messages.getString("TraceSelectionGroup.actionUncheckAll")) { //$NON-NLS-1$
+ @Override
+ public void run() {
+ if (profilerDataPlugins != null) {
+ profilerDataPlugins.unCheckAll();
+ for(ITrace trace : profilerDataPlugins.getPlugins()){
+ viewerTraceSelection.setChecked(trace, trace.isMandatory());
+ }
+ }
+ }
+ };
+ uncheckAllAction.setEnabled(true);
+ mgr.add(checkAllAction);
+ mgr.add(uncheckAllAction);
+ viewerTraceSelection.getControl().setMenu(
+ mgr.createContextMenu(viewerTraceSelection.getControl()));
+ }
+
+ /**
+ * Update trace ids
+ *
+ * @param profilerDataPlugins
+ */
+ public void updateTraceIds(ProfilerDataPlugins profilerDataPlugins) {
+ this.profilerDataPlugins = profilerDataPlugins;
+ if(profilerDataPlugins == null || profilerDataPlugins.getPlugins() == null){
+ viewerTraceSelection.setInput(null);
+ updateTitle(null);
+ }else{
+ viewerTraceSelection.setInput(profilerDataPlugins.getPlugins());
+ viewerTraceSelection.setAllChecked(true);
+ for (ITrace trace : profilerDataPlugins.getPlugins()) {
+ if (trace.isMandatory()) {
+ viewerTraceSelection.setGrayed(trace, true);
+ } else {
+ if(profilerActivator){
+ boolean checked = false;
+ if(defaultPlugins != null){
+ for(int id : defaultPlugins){
+ if(trace.getTraceId() == id){
+ profilerDataPlugins.setChecked(trace, true);
+ viewerTraceSelection.setChecked(trace, true);
+ checked = true;
+ break;
+ }
+ }
+ }if(!checked){
+ profilerDataPlugins.setChecked(trace, false);
+ viewerTraceSelection.setChecked(trace, false);
+ }
+ }else{
+ viewerTraceSelection.setChecked(trace, profilerDataPlugins
+ .isChecked(trace));
+ }
+ }
+ }
+ updateTitle(profilerDataPlugins.getProfilerDataPath().lastSegment());
+ }
+
+ }
+
+ /**
+ * Get traceids from the selected plug-ins
+ *
+ * @return array of the traceids
+ */
+ public int[] getSelectedPluginIds(){
+ if(profilerDataPlugins == null){
+ return new int[0];
+ }
+ List<ITrace> plugins = profilerDataPlugins.getSelectedPlugins();
+ Iterator<ITrace> traces = plugins.iterator();
+ int[] traceIds = new int[plugins.size()];
+ int i = 0;
+ while(traces.hasNext()){
+ traceIds[i++] = traces.next().getTraceId();
+ }
+ Arrays.sort(traceIds);
+ NewPIWizardSettings.getInstance().defaultPlugins = traceIds;
+ return traceIds;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/ProfilerActivatorGroup.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,706 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.internal.pi.wizards.ui;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.MessageFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+
+import com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace;
+import com.nokia.carbide.cpp.pi.PiPlugin;
+import com.nokia.carbide.cpp.pi.export.ITraceProvider;
+import com.nokia.carbide.cpp.pi.wizards.WizardsPlugin;
+import com.nokia.s60tools.ui.preferences.PreferenceUtils;
+
+/**
+ * Provides functionality of the profiler activator
+ */
+public class ProfilerActivatorGroup extends AbstractBaseGroup {
+
+ private TableViewer profileDataTable;
+ private Composite rightButtonsComposite;
+ private Label connectionNameInUseLabel;
+ private IWizardContainer wizardContainer;
+ private NewPIWizardPage wizardPage;
+ private TraceHandler traceHandler;
+ private PluginSelectionGroup pluginSelectionGroup;
+ private Group settingsButtonGroup;
+ private Button refreshListButton;
+ private Button connectionSettingsButton;
+ private Button tracingButton;
+
+ /**
+ * Constructor
+ *
+ * @param parent
+ * instance of the parent composite
+ * @param wizardSettings
+ * instance of the INewPIWizardSettings
+ * @param wizardPage
+ * instance of the NewPIWizardPage
+ * @param wizardContainer
+ * instance of the IWizardContainer
+ */
+ public ProfilerActivatorGroup(Composite parent,
+ INewPIWizardSettings wizardSettings, NewPIWizardPage wizardPage,
+ IWizardContainer wizardContainer) {
+ super(parent, wizardSettings, true);
+ this.wizardContainer = wizardContainer;
+ this.wizardPage = wizardPage;
+ traceHandler = new TraceHandler(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.carbide.cpp.internal.pi.wizards.ui.AbstractBaseGroup#createContent
+ * ()
+ */
+ protected void createContent() {
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ this.setLayout(gridLayout);
+ this.setLayoutData(new GridData(GridData.FILL_BOTH));
+ this.setText(Messages.getString("NewPIWizardPageInputTask.fromDevice")); //$NON-NLS-1$
+
+ final Composite leftTables = new Composite(this, SWT.NONE);
+ leftTables.setLayout(new GridLayout());
+ leftTables.setLayoutData(new GridData(GridData.FILL_BOTH));
+ pluginSelectionGroup = new PluginSelectionGroup(leftTables,
+ wizardSettings, true);
+
+ new Label(leftTables, SWT.NONE).setText(Messages
+ .getString("ProfilerActivatorGroup.profilerDataTableTitle")); //$NON-NLS-1$
+ profileDataTable = new TableViewer(leftTables, SWT.BORDER | SWT.SINGLE
+ | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
+
+ TableColumn column = new TableColumn(profileDataTable.getTable(),
+ SWT.NONE);
+ column.setText(Messages.getString("ProfilerActivatorGroup.columnName")); //$NON-NLS-1$
+ column.setWidth(200);
+ column.setResizable(true);
+ column.setMoveable(true);
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (!(e.widget instanceof TableColumn))
+ return;
+ ((AbstractBaseSorter) profileDataTable.getSorter()).doSort(0);
+ profileDataTable.refresh();
+
+ }
+ });
+
+ column = new TableColumn(profileDataTable.getTable(), SWT.NONE);
+ column.setText(Messages.getString("ProfilerActivatorGroup.columnTime")); //$NON-NLS-1$
+ column.setWidth(120);
+ column.setResizable(true);
+ column.setMoveable(true);
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (!(e.widget instanceof TableColumn))
+ return;
+ ((AbstractBaseSorter) profileDataTable.getSorter()).doSort(1);
+ profileDataTable.refresh();
+
+ }
+ });
+
+ column = new TableColumn(profileDataTable.getTable(), SWT.NONE);
+ column.setText(Messages.getString("ProfilerActivatorGroup.columnSize")); //$NON-NLS-1$
+ column.setWidth(120);
+ column.setResizable(true);
+ column.setMoveable(true);
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (!(e.widget instanceof TableColumn))
+ return;
+ ((AbstractBaseSorter) profileDataTable.getSorter()).doSort(2);
+ profileDataTable.refresh();
+
+ }
+ });
+
+ GridData fileLogsTableGridData = new GridData(GridData.FILL_BOTH);
+ fileLogsTableGridData.minimumHeight = 120;
+ profileDataTable.getTable().setLayoutData(fileLogsTableGridData);
+ profileDataTable.getTable().setHeaderVisible(true);
+ profileDataTable.getTable().setLinesVisible(true);
+ profileDataTable.setContentProvider(new IStructuredContentProvider() {
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof List<?>) {
+ return ((List<?>) inputElement).toArray();
+ }
+ return new Object[0];
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {
+ }
+
+ });
+
+ profileDataTable.setSorter(new AbstractBaseSorter(profileDataTable
+ .getTable(), 0) {
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ ProfilerDataPlugins pdp1 = (ProfilerDataPlugins) e1;
+ ProfilerDataPlugins pdp2 = (ProfilerDataPlugins) e2;
+ int returnCode = 0;
+ switch (column) {
+ case 0:
+ returnCode = pdp1
+ .getProfilerDataPath()
+ .lastSegment()
+ .compareTo(pdp2.getProfilerDataPath().lastSegment());
+ break;
+ case 1:
+ returnCode = compareNumber(pdp1.getTime(), pdp2.getTime());
+ break;
+ case 2:
+ returnCode = compareNumber(pdp1.getSize(), pdp2.getSize());
+ break;
+
+ default:
+
+ break;
+ }
+ if (!sortAscending)
+ returnCode = -returnCode;
+ return returnCode;
+ }
+ });
+
+ profileDataTable.setLabelProvider(new AbstractLabelProvider() {
+ public String getColumnText(Object element, int columnIndex) {
+ ProfilerDataPlugins plugins = (ProfilerDataPlugins) element;
+
+ switch (columnIndex) {
+ case 0:
+ return plugins.getProfilerDataPath().lastSegment();
+ case 1:
+ SimpleDateFormat formatter = new SimpleDateFormat("mm:ss"); //$NON-NLS-1$
+ return formatter.format(new Date(plugins.getTime()));
+ case 2:
+ return String.valueOf((plugins.getSize() + 512) / 1024);
+ default:
+ break;
+ }
+ return ""; //$NON-NLS-1$
+ }
+ });
+
+ rightButtonsComposite = new Composite(this, SWT.NONE);
+
+ GridData rightButtonsCompositeGridData = new GridData(
+ GridData.HORIZONTAL_ALIGN_FILL);
+ rightButtonsComposite.setLayoutData(rightButtonsCompositeGridData);
+ rightButtonsComposite.setLayout(new GridLayout());
+
+ // Connection settings button
+ settingsButtonGroup = new Group(rightButtonsComposite, SWT.NONE);
+ settingsButtonGroup.setLayout(new GridLayout());
+ settingsButtonGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ refreshListButton = new Button(settingsButtonGroup, SWT.PUSH);
+ refreshListButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ refreshListButton.setText(Messages
+ .getString("ProfilerActivatorGroup.refreshButtonName")); //$NON-NLS-1$
+ refreshListButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updatePlugins(traceHandler.fetchAvailablePlugins());
+ }
+ });
+
+ connectionSettingsButton = new Button(settingsButtonGroup, SWT.PUSH);
+ connectionSettingsButton.setLayoutData(new GridData(
+ GridData.FILL_HORIZONTAL));
+ connectionSettingsButton
+ .setText(Messages
+ .getString("ProfilerActivatorGroup.connectionSettingsButtonName")); //$NON-NLS-1$
+ connectionSettingsButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Shell shell = PiPlugin.getCurrentlyActiveWbWindowShell();
+ PreferenceUtils.openPreferencePage(PiPlugin.getTraceProvider()
+ .getTraceSourcePreferencePageId(), shell);
+ updateConnectionText();
+ }
+ });
+ // Connection settings labels
+ Label connectionTextLabel = new Label(settingsButtonGroup, SWT.LEFT);
+ connectionTextLabel.setText(Messages
+ .getString("ProfilerActivatorGroup.currentlyUsingTitle")); //$NON-NLS-1$
+ connectionTextLabel.setLayoutData(new GridData(
+ GridData.HORIZONTAL_ALIGN_CENTER));
+
+ connectionNameInUseLabel = new Label(settingsButtonGroup, SWT.NONE);
+ connectionNameInUseLabel.setLayoutData(new GridData(
+ GridData.HORIZONTAL_ALIGN_CENTER));
+ Group traceButtonGroup = new Group(rightButtonsComposite, SWT.NONE);
+ traceButtonGroup.setLayout(new GridLayout());
+ traceButtonGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
+ new Label(traceButtonGroup, SWT.LEFT).setText(Messages
+ .getString("ProfilerActivatorGroup.filePrefixTitle")); //$NON-NLS-1$
+ final Text filePrefixText = new Text(traceButtonGroup, SWT.BORDER);
+ filePrefixText.setText("PIProfiler_#"); //$NON-NLS-1$
+ filePrefixText.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ // Start/Stop tracing button
+ tracingButton = new Button(traceButtonGroup, SWT.PUSH);
+ tracingButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ tracingButton.setText(Messages
+ .getString("ProfilerActivatorGroup.startTracingButtonName")); //$NON-NLS-1$
+ tracingButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (PiPlugin.getTraceProvider().isListening()) {
+ addTraceFile(traceHandler.stopTrace());
+ } else {
+ traceHandler.startTrace(filePrefixText.getText(),
+ pluginSelectionGroup.getSelectedPluginIds());
+ }
+ updateButtons();
+ }
+ });
+
+ }
+
+ /**
+ * Compare two long number
+ *
+ * @param one
+ * @param two
+ * @return result of the comparison
+ */
+ private int compareNumber(long one, long two) {
+ if (one > two) {
+ return 1;
+ } else if (one < two) {
+ return -1;
+ } else {
+ return 0;
+ }
+ }
+
+ /**
+ * updateConnectionText updates connection text to match used settings
+ */
+ private void updateConnectionText(boolean forceUpdate) {
+ traceHandler.updateCurrenConnection();
+ if (pluginSelectionGroup.getSelectedPluginIds().length <= 0
+ || forceUpdate) {
+ updatePlugins(traceHandler.fetchAvailablePlugins());
+ }
+ }
+
+ /**
+ * updateConnectionText updates connection text to match used settings
+ */
+ private void updateConnectionText() {
+ traceHandler.updateCurrenConnection();
+ }
+
+ /**
+ * Set current connection name
+ *
+ * @param connection
+ * the current connection name
+ */
+ public void setCurrentConnection(final String connection) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ connectionNameInUseLabel.setText(connection);
+ getParent().layout(true, true);
+ }
+ });
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.carbide.cpp.internal.pi.wizards.ui.AbstractBaseGroup#getTable()
+ */
+ @Override
+ public Table getTable() {
+ return profileDataTable.getTable();
+ }
+
+ @Override
+ public IStatus validateContent(NewPIWizard wizardPage) {
+ List<ProfilerDataPlugins> dataFiles = getProfilerDataFiles();
+ if (dataFiles != null && dataFiles.size() > 0) {
+ wizardPage.setProfilerDataFiles(getProfilerDataFiles());
+ return Status.OK_STATUS;
+ } else {
+ return new Status(
+ Status.INFO,
+ WizardsPlugin.PLUGIN_ID,
+ Messages
+ .getString("ProfilerActivatorGroup.profilerGroupDescription")); //$NON-NLS-1$
+ }
+
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ if (visible) {
+ updateConnectionText(false);
+ }
+ super.setVisible(visible);
+
+ }
+
+ private void updatePlugins(final List<ITrace> plugins) {
+ pluginSelectionGroup.updateTraceIds(new ProfilerDataPlugins(
+ new Path(""), plugins)); //$NON-NLS-1$
+ updateButtons();
+ }
+
+ /**
+ * Add given trace data file to profiler data file table
+ *
+ * @param path
+ */
+ private void addTraceFile(final IPath path) {
+ if (path == null) {
+ return;
+ }
+ ProfilerDataPlugins dataPlugins = removeWithPath(path
+ .removeFileExtension().addFileExtension(
+ ITraceProvider.BASE_FILE));
+ if (dataPlugins != null) {
+ try {
+ addProfilerDataFile(path, dataPlugins.getTime(), path.toFile()
+ .length());
+ refreshTable(profileDataTable, true);
+ } catch (Exception e) {
+ wizardPage
+ .setErrorMessage(e.getMessage()
+ + " " + Messages.getString("ProfilerActivatorGroup.tryDeselectPluginsFromList")); //$NON-NLS-1$ //$NON-NLS-2$
+ wizardPage.setPageComplete(false);
+ refreshTable(profileDataTable, false);
+ path.toFile().delete();
+ }
+ }
+ }
+
+ public NewPIWizardPage getWizardPage() {
+ return wizardPage;
+ }
+
+ public IWizardContainer getWizardContainer() {
+ return wizardContainer;
+ }
+
+ /**
+ * Update trace data files
+ *
+ * @param path
+ * @param time
+ * @param size
+ */
+ public void updateTraceDataFile(final IPath path, final long time,
+ final long size) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ // remove if both time and size are -1
+ if (time == -1 && size == -1) {
+ removeWithPath(path);
+ } else {
+ updateProfilerDataFile(path, time, size);
+ }
+ refreshTable(profileDataTable, false);
+ }
+ });
+ }
+
+ /**
+ * Update buttons
+ */
+ public void updateButtons() {
+ if (PiPlugin.getTraceProvider().isListening()) {
+ wizardPage.setErrorMessage(null);
+ refreshListButton.setEnabled(false);
+ connectionSettingsButton.setEnabled(false);
+ ((NewPIWizardPageInputTask) wizardPage)
+ .setButtonGroupEnabled(false);
+ tracingButton.setText(Messages
+ .getString("ProfilerActivatorGroup.stopTracingButtonName")); //$NON-NLS-1$
+ } else {
+ refreshListButton.setEnabled(true);
+ connectionSettingsButton.setEnabled(true);
+ ((NewPIWizardPageInputTask) wizardPage).setButtonGroupEnabled(true);
+ tracingButton
+ .setText(Messages
+ .getString("ProfilerActivatorGroup.startTracingButtonName")); //$NON-NLS-1$
+ }
+
+ if (pluginSelectionGroup.getSelectedPluginIds().length <= 0) {
+ tracingButton.setEnabled(false);
+ } else {
+ tracingButton.setEnabled(true);
+ }
+ }
+
+ /**
+ * Generate next dat file name
+ *
+ * @param path
+ * @return
+ */
+ private IPath generateDatFile(IPath path) {
+ while (path.toFile().exists()) {
+ String file = path.lastSegment();
+ String fileExtension = path.getFileExtension();
+ file = file.substring(0, file.lastIndexOf("." + fileExtension)); //$NON-NLS-1$
+ int index = file.lastIndexOf("_"); //$NON-NLS-1$
+ if (index != -1) {
+ try {
+ int count = Integer.valueOf(file.substring(index + 1));
+ count++;
+ file = file.substring(0, index + 1) + count;
+ path = path.removeLastSegments(1).append(
+ file + "." + fileExtension); //$NON-NLS-1$
+ } catch (Exception e) {
+ path = path.removeLastSegments(1).append(
+ file + "_0." + fileExtension); //$NON-NLS-1$
+ }
+
+ } else {
+ path = path.removeLastSegments(1).append(
+ file + "_0." + fileExtension); //$NON-NLS-1$
+ }
+ }
+ return path;
+
+ }
+
+ /**
+ * Handle temporary profiler data files in case user is tried to close
+ * wizard and user has traced some data from device
+ *
+ * @param forceRemove
+ */
+ public void handleTemporaryProfilerDataFiles(boolean forceRemove) {
+ final List<ProfilerDataPlugins> plugins = new ArrayList<ProfilerDataPlugins>();
+ plugins.addAll(getProfilerDataFiles());
+ getProfilerDataFiles().clear();
+ if (forceRemove) {
+ deleteProfilerDataFiles(plugins);
+ } else if (plugins.size() > 0) {
+ boolean answer = MessageDialog
+ .openQuestion(
+ Display.getDefault().getActiveShell(),
+ Messages
+ .getString("ProfilerActivatorGroup.questionDialogTitle"), Messages.getString("ProfilerActivatorGroup.questionDialogMessage")); //$NON-NLS-1$ //$NON-NLS-2$
+ if (answer) {
+ // open file dialog for selecting a crash file
+ DirectoryDialog dialog = new DirectoryDialog(Display
+ .getDefault().getActiveShell());
+ dialog
+ .setText(Messages
+ .getString("ProfilerActivatorGroup.directorySelectionDialogTitle")); //$NON-NLS-1$
+ final String result = dialog.open();
+ if (result != null) {
+ WorkspaceJob job = new WorkspaceJob(
+ Messages
+ .getString("ProfilerActivatorGroup.movingProfilerDataFilesJob") + result) { //$NON-NLS-1$
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor)
+ throws CoreException {
+ monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+ for (ProfilerDataPlugins plugin : plugins) {
+ IPath dataFile = plugin.getProfilerDataPath();
+ IPath targetFile = generateDatFile(new Path(
+ result).append(dataFile.lastSegment()));
+ try {
+ moveFile(dataFile, targetFile,
+ new SubProgressMonitor(monitor,
+ IProgressMonitor.UNKNOWN));
+ } catch (Exception e) {
+ List<ProfilerDataPlugins> list = new ArrayList<ProfilerDataPlugins>();
+ list.add(plugin);
+ deleteProfilerDataFiles(list);
+ e.printStackTrace();
+ MessageDialog
+ .openError(
+ getShell(),
+ Messages
+ .getString("ProfilerActivatorGroup.errorDialogTitle"), MessageFormat.format(Messages.getString("ProfilerActivatorGroup.failedToMoveFileTo"), dataFile.lastSegment(), result)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+ } else {
+ deleteProfilerDataFiles(plugins);
+ }
+ } else {
+ deleteProfilerDataFiles(plugins);
+ }
+ }
+ }
+
+ /**
+ * Delete profiler data files
+ *
+ * @param plugins
+ */
+ private void deleteProfilerDataFiles(final List<ProfilerDataPlugins> plugins) {
+ WorkspaceJob job = new WorkspaceJob(Messages
+ .getString("ProfilerActivatorGroup.removeProfilerDataFilesJob")) { //$NON-NLS-1$
+
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor)
+ throws CoreException {
+ monitor.beginTask("", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+ for (ProfilerDataPlugins plugin : plugins) {
+ IPath dataFile = plugin.getProfilerDataPath();
+ monitor
+ .setTaskName(MessageFormat
+ .format(
+ Messages
+ .getString("ProfilerActivatorGroup.deletingProfilerDataFiles"), dataFile.lastSegment())); //$NON-NLS-1$
+ if (dataFile.toFile().exists()) {
+ while (!dataFile.toFile().delete()) {
+ if (monitor.isCanceled()) {
+ break;
+ }
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ }
+ ;
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+
+ };
+ job.schedule();
+
+ }
+
+ /**
+ * Move profiler data file from temporary location to user selected target
+ *
+ * @param source
+ * @param target
+ * @param monitor
+ * @throws IOException
+ */
+ private void moveFile(final IPath source, IPath target,
+ IProgressMonitor monitor) throws IOException {
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+ InputStream in = null;
+ OutputStream out = null;
+ try {
+ monitor
+ .beginTask(
+ MessageFormat
+ .format(
+ Messages
+ .getString("ProfilerActivatorGroup.copyingProfilerDataFiles"), source.lastSegment(), target.removeLastSegments(1)), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+ in = new FileInputStream(source.toFile());
+ out = new FileOutputStream(target.toFile());
+ int bufferSize = 1024;
+ byte[] buf = new byte[bufferSize];
+ int len;
+ while ((len = in.read(buf)) > 0) {
+ out.write(buf, 0, len);
+ out.flush();
+ }
+
+ } finally {
+ if (in != null) {
+ in.close();
+ }
+ if (out != null) {
+ out.close();
+ }
+ monitor
+ .setTaskName(MessageFormat
+ .format(
+ Messages
+ .getString("ProfilerActivatorGroup.deletingProfilerDataFiles"), source.lastSegment())); //$NON-NLS-1$
+ while (!source.toFile().delete()) {
+ if (monitor.isCanceled()) {
+ break;
+ }
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ monitor.done();
+ }
+ }
+}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/ProfilerDataPlugins.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/ProfilerDataPlugins.java Wed Jun 23 15:05:09 2010 +0300
@@ -28,8 +28,10 @@
public class ProfilerDataPlugins {
- private Map<ITrace, Boolean> pluginsSelectionMap;
+ private Map<ITrace, Boolean> pluginsSelectionMap = new HashMap<ITrace, Boolean>();
private final IPath profilerDataPath;
+ private long time;
+ private long size;
/**
* Constructor
@@ -39,7 +41,9 @@
*/
public ProfilerDataPlugins(IPath profilerDataPath, List<ITrace> plugins){
this.profilerDataPath = profilerDataPath;
- initPlugins(plugins);
+ if(plugins != null){
+ initPlugins(plugins);
+ }
}
/**
@@ -48,7 +52,6 @@
* @param plugins list of the plugins
*/
public void initPlugins(List<ITrace> plugins){
- pluginsSelectionMap = new HashMap<ITrace, Boolean>();
removeDuplicatePriorityPlugin(plugins);
for(ITrace trace : plugins){
pluginsSelectionMap.put(trace, true);
@@ -56,6 +59,17 @@
}
/**
+ * Update both time and size
+ *
+ * @param time
+ * @param size
+ */
+ public void updateTimeAndSize(long time, long size){
+ this.time += time;
+ this.size = size;
+ }
+
+ /**
* Get list of the plugins
*
* @return list of the plugins
@@ -107,7 +121,7 @@
*/
public void setChecked(ITrace trace, boolean checked){
if(pluginsSelectionMap.containsKey(trace)){
- pluginsSelectionMap.put(trace, new Boolean(checked));
+ pluginsSelectionMap.put(trace, Boolean.valueOf(checked));
}
}
@@ -127,25 +141,12 @@
*/
public void unCheckAll(){
for(ITrace trace : getPlugins()){
- if(!isMandatory(trace)){
+ if(!trace.isMandatory()){
setChecked(trace, false);
- }
+ }
}
}
- /**
- * Check whether given trace mandatory or not
- * @param trace
- * @return
- */
- public boolean isMandatory(ITrace trace){
- if(pluginsSelectionMap.containsKey(trace)){
- if(trace.getTraceId() == 1){
- return true;
- }
- }
- return false;
- }
/**
* Get profiler data file's path
@@ -173,4 +174,19 @@
}
}
}
+
+ /**
+ * @return the time
+ */
+ public long getTime() {
+ return time;
+ }
+
+ /**
+ * @return the size
+ */
+ public long getSize() {
+ return size;
+ }
}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/TraceHandler.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,308 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.internal.pi.wizards.ui;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.swt.widgets.Display;
+
+import com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace;
+import com.nokia.carbide.cpp.pi.PiPlugin;
+import com.nokia.carbide.cpp.pi.export.ITraceClientNotificationsIf;
+import com.nokia.carbide.cpp.pi.wizards.WizardsPlugin;
+
+/**
+ * Helper class to handle traces
+ */
+public class TraceHandler implements ITraceClientNotificationsIf {
+
+ private NewPIWizardPage wizardPage;
+ private IWizardContainer wizardContainer;
+ private ProfilerActivatorGroup profilerActivatorGroup;
+
+ /**
+ * Constructor
+ *
+ * @param profilerActivatorGroup
+ * instance of the ProfilerActivatorGroup
+ */
+ public TraceHandler(ProfilerActivatorGroup profilerActivatorGroup) {
+ this.profilerActivatorGroup = profilerActivatorGroup;
+ this.wizardPage = profilerActivatorGroup.getWizardPage();
+ this.wizardContainer = profilerActivatorGroup.getWizardContainer();
+
+ }
+
+ /**
+ * Update current connection
+ *
+ */
+ public void updateCurrenConnection() {
+ try {
+ IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ monitor.beginTask(Messages.getString("TraceHandler.resolvingCurrentConnection"), //$NON-NLS-1$
+ IProgressMonitor.UNKNOWN);
+ try {
+ String currenConnection = PiPlugin.getTraceProvider()
+ .getDisplayNameForCurrentConnection(monitor);
+ profilerActivatorGroup
+ .setCurrentConnection(currenConnection);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ wizardContainer.run(true, true, runnableWithProgress);
+ } catch (InvocationTargetException e) {
+ if(e.getCause() instanceof CoreException){
+ updateStatus(((CoreException)e.getCause()).getStatus());
+ }else{
+ notifyError(e.getMessage());
+ }
+ } catch (InterruptedException e) {
+ notifyError(e.getMessage());
+ }
+ }
+
+ /**
+ * Fetch available plug-ins list
+ *
+ */
+ public List<ITrace> fetchAvailablePlugins() {
+ final List<ITrace> plugins = new ArrayList<ITrace>();
+ try {
+ IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException{
+ monitor.beginTask(Messages.getString("TraceHandler.fetchingPluginsList"), //$NON-NLS-1$
+ IProgressMonitor.UNKNOWN);
+ try {
+ plugins.addAll(PiPlugin.getTraceProvider()
+ .getAvailableSamplers(TraceHandler.this, monitor));
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+
+ }
+ };
+ wizardContainer.run(true, false, runnableWithProgress);
+ if(wizardPage instanceof INewPIWizardSettings){
+ ((INewPIWizardSettings)wizardPage).validatePage();
+ }
+
+ return plugins;
+ }catch (InvocationTargetException e) {
+ if(e.getCause() instanceof CoreException){
+ updateStatus(((CoreException)e.getCause()).getStatus());
+ }else{
+ notifyError(e.getMessage());
+ }
+ } catch (InterruptedException e) {
+ notifyError(e.getMessage());
+ }
+ return null;
+ }
+
+ /**
+ * Start trace
+ *
+ * @param fileName
+ * for new profiler data file
+ * @param traceIDs
+ * selected plug-ins to be profiling
+ */
+ public void startTrace(final String fileName, final int[] traceIDs) {
+
+ try {
+ IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ monitor.beginTask(Messages.getString("TraceHandler.preparingTracing"), //$NON-NLS-1$
+ IProgressMonitor.UNKNOWN);
+ try {
+
+ PiPlugin.getTraceProvider().startTrace(
+ fileName,
+ traceIDs,
+ TraceHandler.this,
+ new SubProgressMonitor(monitor,
+ IProgressMonitor.UNKNOWN));
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+
+ }
+ };
+ wizardContainer.run(true, false, runnableWithProgress);
+
+ } catch (InvocationTargetException e) {
+ if(e.getCause() instanceof CoreException){
+ updateStatus(((CoreException)e.getCause()).getStatus());
+ }else{
+ notifyError(e.getMessage());
+ }
+ } catch (InterruptedException e) {
+ notifyError(e.getMessage());
+ }
+ }
+
+ /**
+ * Stop trace
+ *
+ * @return
+ */
+ public IPath stopTrace() {
+ final IPath[] path = new Path[1];
+ try {
+ IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ monitor.beginTask(Messages.getString("TraceHandler.creatingProfilerDataFile"), //$NON-NLS-1$
+ IProgressMonitor.UNKNOWN);
+ try {
+ path[0] = PiPlugin.getTraceProvider().stopTrace(false);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ wizardContainer.run(true, false, runnableWithProgress);
+ return path[0];
+ } catch (InvocationTargetException e) {
+ if(e.getCause() instanceof CoreException){
+ updateStatus(((CoreException)e.getCause()).getStatus());
+ }else{
+ notifyError(e.getMessage());
+ }
+
+ } catch (InterruptedException e) {
+ notifyError(e.getMessage());
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.carbide.cpp.pi.export.ITraceClientNotificationsIf#notifyError
+ * (java.lang.String)
+ */
+ public void notifyError(String message) {
+ updateStatus(createStatus(IStatus.ERROR, message));
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.carbide.cpp.pi.export.ITraceClientNotificationsIf#notifyInformation
+ * (java.lang.String)
+ */
+ public void notifyInformation(String message) {
+ updateStatus(createStatus(IStatus.INFO, message));
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.carbide.cpp.pi.export.ITraceClientNotificationsIf#notifyWarning
+ * (java.lang.String)
+ */
+ public void notifyWarning(String message) {
+ updateStatus(createStatus(IStatus.WARNING, message));
+
+ }
+
+ /**
+ * Update status for the wizard
+ *
+ * @param status
+ */
+ private void updateStatus(final IStatus status) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ wizardPage.setErrorMessage(null);
+ profilerActivatorGroup.updateButtons();
+ if (status.getSeverity() == IStatus.OK) {
+ wizardPage.setMessage(status.getMessage());
+ wizardPage.setPageComplete(true);
+ } else if (status.getSeverity() == IStatus.ERROR) {
+ wizardPage.setErrorMessage(status.getMessage());
+ wizardPage.setPageComplete(false);
+ } else if (status.getSeverity() == IStatus.INFO) {
+ wizardPage.setMessage(status.getMessage());
+ wizardPage.setPageComplete(false);
+ } else if (status.getSeverity() == IStatus.WARNING) {
+ wizardPage.setMessage(status.getMessage());
+ wizardPage.setPageComplete(true);
+ }else if (status.getSeverity() == IStatus.CANCEL) {
+ wizardPage.setMessage(status.getMessage());
+ wizardPage.setPageComplete(false);
+ }
+
+ }
+ });
+ }
+
+ /**
+ * Create a status
+ *
+ * @param severity
+ * of the status
+ * @param message
+ * of the status
+ * @return created status
+ */
+ private IStatus createStatus(int severity, String message) {
+ return new Status(severity, WizardsPlugin.PLUGIN_ID, message);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.carbide.cpp.pi.export.ITraceClientNotificationsIf#updateTraceDataFile(org.eclipse.core.runtime.IPath, long, long)
+ */
+ public void updateTraceDataFile(IPath path, long time, long size) {
+ profilerActivatorGroup.updateTraceDataFile(path, time, size);
+
+ }
+}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/TraceSelectionGroup.java Wed Jun 23 14:49:59 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-package com.nokia.carbide.cpp.internal.pi.wizards.ui;
-
-import java.text.MessageFormat;
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.layout.TableColumnLayout;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.window.ToolTip;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Table;
-
-import com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace;
-
-public class TraceSelectionGroup extends AbstractBaseGroup {
-
- private CheckboxTableViewer viewerTraceSelection;
- private ProfilerDataPlugins profilerDataPlugins;
-
- /**
- * Constructor
- *
- * @param parent
- * instance of the parent composite
- * @param wizardSettings
- * instance of the INewPIWizardSettings
- */
- public TraceSelectionGroup(Composite parent,
- INewPIWizardSettings wizardSettings) {
- super(parent, wizardSettings);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.nokia.carbide.cpp.internal.pi.wizards.ui.AbstractBaseGroup#createContent
- * ()
- */
- public void createContent() {
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- this.setLayout(gridLayout);
- this.setLayoutData(new GridData(GridData.FILL_BOTH));
- this.setText(Messages.getString("TraceSelectionGroup.groupTitle")); //$NON-NLS-1$
-
- final Composite tablePanel = new Composite(this, SWT.NONE);
- final GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
- tablePanel.setLayoutData(layoutData);
-
- viewerTraceSelection = CheckboxTableViewer.newCheckList(tablePanel,
- SWT.BORDER | SWT.FULL_SELECTION);
- viewerTraceSelection
- .setContentProvider(new IStructuredContentProvider() {
-
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof List<?>) {
- return ((List<?>) inputElement).toArray();
- }
- return new Object[0];
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput,
- Object newInput) {
- }
-
- });
- viewerTraceSelection.setSorter(new ViewerSorter() {
-
- @Override
- public int compare(Viewer viewer, Object e1, Object e2) {
- if (profilerDataPlugins == null) {
- return 0;
- }
- ITrace trace1 = (ITrace) e1;
- ITrace trace2 = (ITrace) e2;
- int returnCode = 0;
- if (profilerDataPlugins.isMandatory(trace1) == true
- && profilerDataPlugins.isMandatory(trace2) == true) {
- returnCode = 0;
- } else if (profilerDataPlugins.isMandatory(trace1) == true
- && profilerDataPlugins.isMandatory(trace2) == false) {
- returnCode = -1;
- } else if (profilerDataPlugins.isMandatory(trace1) == false
- && profilerDataPlugins.isMandatory(trace2) == true) {
- returnCode = 1;
- } else {
- returnCode = trace1.getTraceTitle().compareTo(
- trace2.getTraceTitle());
- }
- return returnCode;
- }
-
- });
- Table table = viewerTraceSelection.getTable();
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
- addActions();
-
- ColumnViewerToolTipSupport.enableFor(viewerTraceSelection,
- ToolTip.NO_RECREATE);
-
- TableViewerColumn column = new TableViewerColumn(viewerTraceSelection,
- SWT.NONE);
- column.setLabelProvider(new ColumnLabelProvider() {
- @Override
- public String getText(final Object element) {
- if (element instanceof ITrace) {
- return ((ITrace) element).getTraceTitle();
- }
- return element.toString();
- }
-
- @Override
- public String getToolTipText(Object element) {
- StringBuilder sb = new StringBuilder(((ITrace) element)
- .getTraceTitle());
- if (((ITrace) element).getTraceId() == 1) {
- sb.append(Messages.getString("TraceSelectionGroup.mandatory")); //$NON-NLS-1$
- }
- return sb.toString();
- }
-
- @Override
- public Color getForeground(Object element) {
- if (((ITrace) element).getTraceId() == 1) {
- return Display.getCurrent().getSystemColor(
- SWT.COLOR_DARK_GRAY);
- }
- return null;
- }
-
- @Override
- public Point getToolTipShift(Object object) {
- return new Point(5, 5);
- }
-
- @Override
- public int getToolTipTimeDisplayed(Object object) {
- return 5000;
- }
- });
-
- column.getColumn().setText(Messages.getString("TraceSelectionGroup.piView")); //$NON-NLS-1$
-
- TableColumnLayout tableColumnLayout = new TableColumnLayout();
- tablePanel.setLayout(tableColumnLayout);
- tableColumnLayout.setColumnData(column.getColumn(),
- new ColumnWeightData(1));// column weight 1 to fill the whole
- // table width
-
- viewerTraceSelection.setAllChecked(true);
- viewerTraceSelection.addCheckStateListener(new ICheckStateListener() {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged
- * (org.eclipse.jface.viewers.CheckStateChangedEvent)
- */
- public void checkStateChanged(CheckStateChangedEvent event) {
- if (event.getChecked() == false
- && viewerTraceSelection.getGrayed(event.getElement())) {
- // mandatory view; don't allow to deselect it
- viewerTraceSelection.setChecked(event.getElement(), true);
- } else {
- ITrace plugin = (ITrace) event.getElement();
- profilerDataPlugins.setChecked(plugin, event.getChecked());
- }
- }
- });
- }
-
- /**
- * Update group's title
- *
- * @param fileName for the group title
- */
- private void updateTitle(String fileName){
- if(fileName == null){
- this.setText(Messages.getString("TraceSelectionGroup.groupTitle"));
- }else{
- this.setText(MessageFormat.format(Messages.getString("TraceSelectionGroup.groupTitleFor"), fileName));
- }
-
- }
-
- /**
- * Add actions
- */
- private void addActions() {
- final MenuManager mgr = new MenuManager();
- Action checkAllAction = new Action(Messages.getString("TraceSelectionGroup.actionCheckAll")) { //$NON-NLS-1$
- @Override
- public void run() {
- if (profilerDataPlugins != null) {
- profilerDataPlugins.checkAll();
- viewerTraceSelection.setAllChecked(true);
- }
- }
- };
- checkAllAction.setEnabled(true);
-
- Action uncheckAllAction = new Action(Messages.getString("TraceSelectionGroup.actionUncheckAll")) { //$NON-NLS-1$
- @Override
- public void run() {
- if (profilerDataPlugins != null) {
- profilerDataPlugins.unCheckAll();
- for(ITrace trace : profilerDataPlugins.getPlugins()){
- viewerTraceSelection.setChecked(trace, profilerDataPlugins.isChecked(trace));
- }
- }
- }
- };
- uncheckAllAction.setEnabled(true);
- mgr.add(checkAllAction);
- mgr.add(uncheckAllAction);
- viewerTraceSelection.getControl().setMenu(
- mgr.createContextMenu(viewerTraceSelection.getControl()));
- }
-
- /**
- * Update trace ids
- *
- * @param profilerDataPlugins
- */
- public void updateTraceIds(ProfilerDataPlugins profilerDataPlugins) {
- this.profilerDataPlugins = profilerDataPlugins;
- if(profilerDataPlugins == null){
- viewerTraceSelection.setInput(null);
- updateTitle(null);
- }else{
- viewerTraceSelection.setInput(profilerDataPlugins.getPlugins());
- viewerTraceSelection.setAllChecked(true);
- for (ITrace trace : profilerDataPlugins.getPlugins()) {
- if (profilerDataPlugins.isMandatory(trace)) {
- viewerTraceSelection.setGrayed(trace, true);
- } else {
- viewerTraceSelection.setChecked(trace, profilerDataPlugins
- .isChecked(trace));
- }
- }
- updateTitle(profilerDataPlugins.getProfilerDataPath().lastSegment());
- }
-
- }
-
- @Override
- public Table getTable() {
- return viewerTraceSelection.getTable();
- }
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/actions/ToolbarShortcutAction.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.carbide.cpp.internal.pi.wizards.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+import com.nokia.carbide.cpp.internal.pi.wizards.ui.NewPIWizard;
+
+public class ToolbarShortcutAction implements IWorkbenchWindowActionDelegate{
+
+ private IWorkbenchWindow window;
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+ */
+ public void dispose() {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ openWizard(window.getShell());
+ }
+
+ /*
+ * open PI wizard
+ */
+ public static void openWizard(Shell shell){
+ NewPIWizard wizard = new NewPIWizard();
+ WizardDialog wizDialog = new WizardDialog(shell, wizard);
+ wizDialog.setPageSize(600, 600);
+ wizDialog.create();
+ wizDialog.open();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/messages.properties Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/messages.properties Wed Jun 23 15:05:09 2010 +0300
@@ -15,6 +15,8 @@
FileSelectionGroup.profilerDataFilePath=Path
FileSelectionGroup.title=From File System
NewPIWizard.failed.convertFileToIFile=\ failed converFileToIFile
+NewPIWizard.informationDialogMessage=Tracing is activated. In order to coninue you need to stop the tracing.
+NewPIWizard.informationDialogTitle=Peformance Investigator
NewPIWizard.suffixTaskName=({0}/{1})
NewPIWizard.window.title=Performance Investigator Import Wizard
NewPIWizardCustomTask.dat.file.name.must.be.specified=File name must be specified.
@@ -86,7 +88,7 @@
NewPIWizardPageInputTask.1=I/O or parse exception: Trace types in profiler data file cannot be determined.
NewPIWizardPageInputTask.3=Invalid profiler data file.
NewPIWizardPageInputTask.4=Please select at least one PI view.
-NewPIWizardPageInputTask.fromDevice=By executing the profiler on device via TraceViewer
+NewPIWizardPageInputTask.fromDevice=From Device via TraceViewer
NewPIWizardPageInputTask.fromFileSystem=From File System
NewPIWizardPageInputTask.noteImportMayTakeSeveralMinutes=Note: It may take several minutes to import multiple profiler data files
NewPIWizardPageInputTask.profilerDataSourceGroupTitle=Get profiler data:
@@ -137,12 +139,39 @@
NewPIWizardRemovePkgDialog.sample.file=sample file\:
NewPIWizardRemovePkgDialog.sdk=\ / SDK\:
NewPIWizardRemovePkgDialog.shell.title=Remove PKG Files From Import
+ProfilerActivatorGroup.columnName=Name
+ProfilerActivatorGroup.columnSize=Size (KB)
+ProfilerActivatorGroup.columnTime=Time (mm:ss)
+ProfilerActivatorGroup.connectionSettingsButtonName=Connection Settings...
+ProfilerActivatorGroup.copyingProfilerDataFiles=Copying {0} to {1}...
+ProfilerActivatorGroup.currentlyUsingTitle=Currently using:
+ProfilerActivatorGroup.deletingProfilerDataFiles=Deleteing {0} from temporary folder...
+ProfilerActivatorGroup.directorySelectionDialogTitle=Define location of directory where to save profiler data file(s)
+ProfilerActivatorGroup.errorDialogTitle=Performance Investigator
+ProfilerActivatorGroup.failedToMoveFileTo=Failed to move {0} to {1}
+ProfilerActivatorGroup.filePrefixTitle=Profiler Data File Prefix:
+ProfilerActivatorGroup.movingProfilerDataFilesJob=Moving profiler data file(s) to
+ProfilerActivatorGroup.profilerDataTableTitle=Created Profiler Data File(s)
+ProfilerActivatorGroup.profilerGroupDescription=Select plug-ins for tracing and click the Start Tracing button to begin your tracing
+ProfilerActivatorGroup.questionDialogMessage=Do you want to save traced profiler data file(s)?
+ProfilerActivatorGroup.questionDialogTitle=Performance Investigator
+ProfilerActivatorGroup.refreshButtonName=Refresh Plug-ins List
+ProfilerActivatorGroup.removeProfilerDataFilesJob=Removing profiler data file(s)
+ProfilerActivatorGroup.startTracingButtonName=Start Tracing
+ProfilerActivatorGroup.stopTracingButtonName=Stop Tracing
+ProfilerActivatorGroup.tryDeselectPluginsFromList=Try to deselect some of the plug-ins from the list.
+TraceHandler.creatingProfilerDataFile=Creating a profiler data file...
+TraceHandler.fetchingPluginsList=Fetching available plug-ins...
+TraceHandler.preparingTracing=Preparing to start tracing...
+TraceHandler.resolvingCurrentConnection=Resolving current connection...
TraceSelectionGroup.actionCheckAll=Check All
TraceSelectionGroup.actionUncheckAll=Uncheck All
TraceSelectionGroup.groupTitle=PI views included in analysis
TraceSelectionGroup.groupTitleFor=PI views included in analysis for {0}
TraceSelectionGroup.mandatory=\ (mandatory view)
TraceSelectionGroup.piView=PI View
+TraceSelectionGroup.profilerActivatorTableColumn=Plug-ins
+TraceSelectionGroup.profilerActivatorTitle=Select Plug-ins for Tracing
UiFileFilter.build.file.extensions=Build file (.oby)
UiFileFilter.comma.separated.text.file.extensions=Comma separated text file (.csv)
UiFileFilter.executable.file.extensions=Symbian executable (.exe;.dll;,.pdd)
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/util/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/util/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.wizards.ui.util.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/util/PkgListTreeContentProvider.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/util/PkgListTreeContentProvider.java Wed Jun 23 15:05:09 2010 +0300
@@ -119,7 +119,7 @@
}
if (haveConfigWithPKG == false){
if(logWarnings){
- GeneralMessages.PiLog(MessageFormat.format(Messages.getString("PkgListTreeContentProvider.warning.sisBuilderConfiguration.missing"),projects[i].getName()), GeneralMessages.WARNING); //$NON-NLS-1$
+ GeneralMessages.piLog(MessageFormat.format(Messages.getString("PkgListTreeContentProvider.warning.sisBuilderConfiguration.missing"),projects[i].getName()), GeneralMessages.WARNING); //$NON-NLS-1$
}
continue; // must have buildconfig with good PKG to show up
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/views/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.internal.pi.wizards.ui.views;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public final class Messages {
+ private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.wizards.ui.views.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/views/PIView.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,543 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.carbide.cpp.internal.pi.wizards.ui.views;
+
+import java.io.File;
+import java.text.MessageFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.part.ViewPart;
+
+import com.nokia.carbide.cpp.internal.pi.button.ui.ImportBupMapWizardDialog;
+import com.nokia.carbide.cpp.internal.pi.wizards.model.SessionHandler;
+import com.nokia.carbide.cpp.internal.pi.wizards.model.TraceFile;
+import com.nokia.carbide.cpp.internal.pi.wizards.ui.actions.ToolbarShortcutAction;
+import com.nokia.carbide.cpp.pi.editors.PIPageEditor;
+import com.nokia.carbide.cpp.pi.wizards.WizardsPlugin;
+import com.nokia.s60tools.ui.S60ToolsTable;
+import com.nokia.s60tools.ui.S60ToolsTableColumnData;
+import com.nokia.s60tools.ui.S60ToolsTableFactory;
+
+
+public class PIView extends ViewPart implements IResourceChangeListener {
+
+ public static final String ID = "com.nokia.carbide.cpp.internal.pi.wizards.ui.views.PIView"; //$NON-NLS-1$
+ private static final String HELP_CONTEXT_ID = PIPageEditor.PI_ID + ".view"; //$NON-NLS-1$
+ private static final String HELP_CONTEXT_ID_MAIN_PAGE = HELP_CONTEXT_ID + ".pi_view_context"; //$NON-NLS-1$
+ private static final int COLUMN_TRACE_FILE_ID = 0;
+ private static final int COLUMN_PROJECT_NAME_ID = 1;
+ private static final int COLUMN_SDK_NAME_ID = 2;
+ private static final int COLUMN_IMPORT_TIME_ID = 3;
+ private static final int COLUMN_FILE_SIZE_ID = 4;
+ private static final int COLUMN_TRACE_TIME_ID = 5;
+
+ private TableViewer viewer;
+ private Action actionOpenWizard;
+ private Action actionOpenKeyPressWizard;
+ private Action actionDelete;
+ private IWorkspace workspace;
+
+ /*
+ * The content provider class is responsible for
+ * providing objects to the view.
+ */
+ class ViewContentProvider implements IStructuredContentProvider {
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+ }
+ public void dispose() {
+ }
+ public Object[] getElements(Object parent) {
+ return SessionHandler.getInstance().loadTraceFile();
+ }
+ }
+ class ViewLabelProvider extends LabelProvider implements ITableLabelProvider {
+ public String getColumnText(Object obj, int index) {
+ final TraceFile traceFile = (TraceFile)obj;
+ SimpleDateFormat formatter = null;
+ switch (index) {
+ case COLUMN_TRACE_FILE_ID:
+ return traceFile.getTraceFilePath().lastSegment();
+ case COLUMN_PROJECT_NAME_ID:
+ return traceFile.getProjectName();
+ case COLUMN_SDK_NAME_ID:
+ if(traceFile.getSdkName().length() <= 0){
+ return "-"; //$NON-NLS-1$
+ }
+ return traceFile.getSdkName();
+ case COLUMN_IMPORT_TIME_ID:
+ formatter = new SimpleDateFormat("d MMM yyyy HH:mm:ss"); //$NON-NLS-1$
+ return formatter.format(new Date(traceFile.getImportTime()));
+ case COLUMN_FILE_SIZE_ID:
+ IProject project = (IProject) workspace.getRoot().findMember(traceFile.getProjectName());
+ if(project == null){
+ return "-"; //$NON-NLS-1$
+ }
+
+ IResource resource = project.findMember(traceFile.getTraceFilePath().lastSegment());
+ if (resource != null) {
+ SessionHandler.getInstance().removeTraceFile(traceFile);
+ traceFile.setTraceFileSize(resource.getLocation().toFile().length());
+ SessionHandler.getInstance().addTraceFile(traceFile);
+ }
+ return String.valueOf(traceFile.getTraceFileSize() / 1024 );
+ case COLUMN_TRACE_TIME_ID:
+ if(traceFile.getTraceLengthInTime() == -1){
+ return "-"; //$NON-NLS-1$
+ }
+ formatter = new SimpleDateFormat("mm:ss"); //$NON-NLS-1$
+ return formatter.format(new Date(traceFile.getTraceLengthInTime()));
+ default:
+ break;
+ }
+ return getText(obj);
+ }
+ public Image getColumnImage(Object obj, int index) {
+ return getImage(obj);
+ }
+ public Image getImage(Object obj) {
+ return null;
+ }
+ }
+
+ class TableSorter extends ViewerSorter {
+ private Table table;
+ private int column = 0;
+ private boolean sortAscending;
+ public TableSorter(Table table, int column){
+ this.table = table;
+ doSort(column);
+ }
+
+ public void doSort(int column) {
+ sortAscending = !sortAscending;
+
+ // find the TableColumn corresponding to column, and give it a
+ // column direction
+ TableColumn sortByColumn = table.getColumn(column);
+ if (sortByColumn != null) {
+ table.setSortColumn(sortByColumn);
+ table.setSortDirection(sortAscending ? SWT.UP : SWT.DOWN);
+ }
+ this.column = column;
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ TraceFile tf1 = (TraceFile)e1;
+ TraceFile tf2 = (TraceFile)e2;
+ int returnCode = 0;
+ switch (column) {
+ case COLUMN_TRACE_FILE_ID:
+ returnCode = tf1.getTraceFilePath().lastSegment().compareTo(
+ tf2.getTraceFilePath().lastSegment());
+ break;
+ case COLUMN_PROJECT_NAME_ID:
+ returnCode = tf1.getProjectName().compareTo(tf2.getProjectName());
+ break;
+ case COLUMN_SDK_NAME_ID:
+ returnCode = tf1.getSdkName().compareTo(tf2.getSdkName());
+ break;
+ case COLUMN_IMPORT_TIME_ID:
+ returnCode = numericSort(tf1.getImportTime(), tf2.getImportTime());
+ break;
+ case COLUMN_FILE_SIZE_ID:
+ returnCode = numericSort(tf1.getTraceFileSize(), tf2
+ .getTraceFileSize());
+ break;
+ case COLUMN_TRACE_TIME_ID:
+ returnCode = numericSort(tf1.getTraceLengthInTime(), tf2
+ .getTraceLengthInTime());
+ break;
+ default:
+ break;
+ }
+
+ if (!sortAscending)
+ returnCode = -returnCode;
+ return returnCode;
+
+ }
+
+ /**
+ * Numeric sort.
+ * @param num1 1st number to compare.
+ * @param num2 2nd number to compare.
+ * @return Returns a negative integer, zero,
+ * or a positive integer as the first argument
+ * is less than, equal to, or greater
+ * than the second.
+ */
+ private int numericSort(long num1, long num2){
+ long result = (num1 - num2);
+ if(result > 0){
+ return 1;
+ }
+ else if(result < 0){
+ return -1;
+ }
+ else{
+ return 0;
+ }
+ }
+ }
+
+
+ /**
+ * Constructor
+ */
+ public PIView(){
+ workspace = ResourcesPlugin.getWorkspace();
+ workspace.addResourceChangeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.WorkbenchPart#dispose()
+ */
+ @Override
+ public void dispose() {
+ workspace.removeResourceChangeListener(this);
+ super.dispose();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createPartControl(Composite parent) {
+ viewer = createListViewTableViewer(parent);
+ viewer.setContentProvider(new ViewContentProvider());
+ viewer.setLabelProvider(new ViewLabelProvider());
+ viewer.setInput(getViewSite());
+
+
+ // Create the help context id for the viewer's control
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), HELP_CONTEXT_ID_MAIN_PAGE);
+ makeActions();
+ hookContextMenu();
+ hookDoubleClickAction();
+ contributeToActionBars();
+ }
+
+ /**
+ * Creates table viewer for import functions tab item.
+ * @return New <code>TableViewer</code> object instance.
+ */
+ private TableViewer createListViewTableViewer(Composite parent) {
+
+ List<S60ToolsTableColumnData> columnDataArr = new ArrayList<S60ToolsTableColumnData>();
+
+ columnDataArr.add(new S60ToolsTableColumnData(Messages.getString("PIView.columnTraceFileName"), 200, COLUMN_TRACE_FILE_ID)); //$NON-NLS-1$
+ columnDataArr.add(new S60ToolsTableColumnData(Messages.getString("PIView.columnProjectName"), 200, COLUMN_PROJECT_NAME_ID)); //$NON-NLS-1$
+ columnDataArr.add(new S60ToolsTableColumnData(Messages.getString("PIView.columnSDKName"), 150, COLUMN_SDK_NAME_ID)); //$NON-NLS-1$
+ columnDataArr.add(new S60ToolsTableColumnData(Messages.getString("PIView.columnImportTime"), 150, COLUMN_IMPORT_TIME_ID)); //$NON-NLS-1$
+ columnDataArr.add(new S60ToolsTableColumnData(Messages.getString("PIView.columnFileSize"), 140, COLUMN_FILE_SIZE_ID)); //$NON-NLS-1$
+ columnDataArr.add(new S60ToolsTableColumnData(Messages.getString("PIView.columnTime"), 140, COLUMN_TRACE_TIME_ID)); //$NON-NLS-1$
+
+ S60ToolsTableColumnData[] arr
+ = (S60ToolsTableColumnData[]) columnDataArr.toArray(
+ new S60ToolsTableColumnData[0]);
+
+ S60ToolsTable tbl = S60ToolsTableFactory.create(parent, arr);
+
+ TableViewer tblViewer = new TableViewer(tbl.getTableInstance());
+ final TableSorter sorter = new TableSorter(tblViewer.getTable(), COLUMN_IMPORT_TIME_ID);
+ tblViewer.setSorter(sorter);
+ for(int i=0; i < tbl.getColumnCount();i++){
+ final int column = i;
+ tbl.getColumn(i).addSelectionListener(new SelectionAdapter() {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ sorter.doSort(column);
+ viewer.refresh();
+ }
+
+ });
+ }
+
+ tbl.setHostingViewer(tblViewer);
+
+ return tblViewer;
+ }
+
+ private void hookContextMenu() {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ PIView.this.fillContextMenu(manager);
+ }
+ });
+ Menu menu = menuMgr.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, viewer);
+ }
+
+ private void contributeToActionBars() {
+ IActionBars bars = getViewSite().getActionBars();
+ fillLocalToolBar(bars.getToolBarManager());
+ }
+
+
+
+ private void fillContextMenu(IMenuManager manager) {
+ manager.add(actionDelete);
+ }
+
+ private void fillLocalToolBar(IToolBarManager manager) {
+ manager.add(actionOpenWizard);
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ manager.add(actionOpenKeyPressWizard);
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ manager.add(actionDelete);
+ }
+
+ private void makeActions() {
+ // Open Performance Investigator wizard button
+ actionOpenWizard = new Action() {
+ public void run() {
+ ToolbarShortcutAction.openWizard(getSite().getShell());
+ }
+ };
+
+ actionOpenWizard.setText(Messages.getString("PIView.openPIButton")); //$NON-NLS-1$
+ actionOpenWizard.setToolTipText(Messages.getString("PIView.openPIButtonDescription")); //$NON-NLS-1$
+ actionOpenWizard.setImageDescriptor(WizardsPlugin.getImageDescriptor("icons/open_pi_wizard.png")); //$NON-NLS-1$
+
+
+ // Open Performance Investigator Key Press Profile button
+ actionOpenKeyPressWizard = new Action() {
+ public void run() {
+ ImportBupMapWizardDialog wizDialog = new ImportBupMapWizardDialog(getSite().getShell());
+ wizDialog.create();
+ wizDialog.open();
+ }
+ };
+
+ actionOpenKeyPressWizard.setText(Messages.getString("PIView.openKeyPressProfilerButton")); //$NON-NLS-1$
+ actionOpenKeyPressWizard.setToolTipText(Messages.getString("PIView.openKeyPressProfilerButtonDescription")); //$NON-NLS-1$
+ actionOpenKeyPressWizard.setImageDescriptor(WizardsPlugin.getImageDescriptor("icons/open_key_press_profile_wizard.png")); //$NON-NLS-1$
+
+ // Delete selected item button
+ actionDelete = new Action() {
+ public void run() {
+
+ ISelection selection = viewer.getSelection();
+ if (selection == null || selection.isEmpty())
+ return;
+
+ @SuppressWarnings("unchecked")
+ Iterator i = ((IStructuredSelection)selection).iterator();
+ while (i.hasNext()) {
+ SessionHandler.getInstance().removeTraceFile((TraceFile)i.next());
+ }
+ viewer.refresh();
+ }
+ };
+ actionDelete.setText(Messages.getString("PIView.deleteButton")); //$NON-NLS-1$
+ actionDelete.setToolTipText(Messages.getString("PIView.deleteButtonDescription")); //$NON-NLS-1$
+ actionDelete.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
+
+ }
+
+ private void hookDoubleClickAction() {
+ viewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ ISelection selection = event.getSelection();
+ if(selection instanceof StructuredSelection){
+ StructuredSelection structuredSelection = (StructuredSelection)selection;
+ openProfilerDataFile(((TraceFile)structuredSelection.getFirstElement()));
+ }
+ }
+ });
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+
+ }
+
+ /**
+ * Reloads Trace files to table
+ *
+ */
+ public void updateView() {
+ try {
+ getViewSite().getPage().showView(PIView.ID);
+ viewer.refresh();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Open given profiler data file with an editor
+ *
+ * @param traceFile to be opened
+ */
+ private void openProfilerDataFile(final TraceFile traceFile ) {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IResource resource = root.findMember(traceFile.getProjectName());
+
+ IProject project = null;
+ if (resource instanceof IProject) {
+ project = (IProject) resource;
+ } else {
+ return;
+ }
+
+ final IFile analysisFile = project.getFile(traceFile.getTraceFilePath().lastSegment());
+ final File analysisFilePath = analysisFile.getLocation().toFile();
+
+ // open the saved file
+ if (analysisFilePath != null && analysisFilePath.exists() ) {
+ // open the file itself
+ // need to open in UI context
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() , analysisFile, true);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ }else{
+ MessageDialog.openError(getSite().getShell(), Messages
+ .getString("PIView.errorFileIsRemovedDialogTitle"), MessageFormat.format(Messages //$NON-NLS-1$
+ .getString("PIView.errorFileIsRemovedDialogMessage"), //$NON-NLS-1$
+ traceFile.getTraceFilePath().lastSegment()));
+ SessionHandler.getInstance().removeTraceFile(traceFile);
+ viewer.refresh();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
+ */
+ public void resourceChanged(IResourceChangeEvent event) {
+ if(event.getDelta() instanceof IResourceDelta){
+ IResourceDelta rootDelta = (IResourceDelta) event.getDelta();
+ IResourceDeltaVisitor visitor = new IResourceDeltaVisitor() {
+ public boolean visit(IResourceDelta delta) {
+ IResource resource = delta.getResource();
+ if (resource.getType() == IResource.FILE
+ && "npi".equalsIgnoreCase(resource.getFileExtension())) { //$NON-NLS-1$
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ final TraceFile traceFile = SessionHandler.getInstance().getTraceFile(resource.getFullPath());
+ if(traceFile != null){
+ IPath movedTo = delta.getMovedToPath();
+ if(movedTo != null){
+ TraceFile movedToFile = SessionHandler.getInstance().getTraceFile(movedTo);
+ if(movedToFile != null){
+ SessionHandler.getInstance().removeTraceFile(movedToFile);
+ }
+ SessionHandler.getInstance().removeTraceFile(traceFile);
+ traceFile.setTraceFilePath(movedTo);
+ String projectName = movedTo.segment(0);
+ traceFile.setProjectName(projectName);
+ SessionHandler.getInstance().addTraceFile(traceFile);
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ viewer.refresh();
+ }
+ });
+ }else{
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ SessionHandler.getInstance().removeTraceFile(traceFile);
+ viewer.refresh();
+ }
+ });
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ };
+ try {
+ rootDelta.accept(visitor);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/internal/pi/wizards/ui/views/messages.properties Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,14 @@
+PIView.columnFileSize=File size (KB)
+PIView.columnImportTime=Import Time
+PIView.columnProjectName=Project
+PIView.columnSDKName=SDK
+PIView.columnTime=Time (mm:ss)
+PIView.columnTraceFileName=File
+PIView.deleteButton=Remove
+PIView.deleteButtonDescription=Remove selected file(s)
+PIView.openKeyPressProfilerButton=Open Performance Investigator Key Press Profile
+PIView.openKeyPressProfilerButtonDescription=Open Performance Investigator Key Press Profile Import Wizard
+PIView.openPIButton=Open Performance Investigator
+PIView.openPIButtonDescription=Open Performance Investigator Wizard
+PIView.errorFileIsRemovedDialogMessage={0} does not exist anymore.
+PIView.errorFileIsRemovedDialogTitle=Performance Investigator
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/pi/wizards/WizardsPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.wizards/src/com/nokia/carbide/cpp/pi/wizards/WizardsPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,6 +17,7 @@
package com.nokia.carbide.cpp.pi.wizards;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -43,14 +44,14 @@
/**
* This method is called upon plug-in activation
*/
- public void start(BundleContext context) throws Exception {
+ public void start(final BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/
- public void stop(BundleContext context) throws Exception {
+ public void stop(final BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}
@@ -61,4 +62,23 @@
public static WizardsPlugin getDefault() {
return plugin;
}
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path.
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(final String path) {
+ ImageDescriptor descriptor = getDefault().getImageRegistry()
+ .getDescriptor(path);
+ if (descriptor == null) {
+ descriptor = ImageDescriptor.createFromURL(getDefault().getBundle()
+ .getEntry(path));
+ getDefault().getImageRegistry().put(path, descriptor);
+ }
+ return descriptor;
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/META-INF/MANIFEST.MF Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/META-INF/MANIFEST.MF Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Carbide.c++ Performance Investigator
Bundle-SymbolicName: com.nokia.carbide.cpp.pi;singleton:=true
-Bundle-Version: 2.3.0.qualifier
+Bundle-Version: 2.4.0.qualifier
Bundle-Activator: com.nokia.carbide.cpp.pi.PiPlugin
Bundle-Vendor: Nokia
Require-Bundle: org.eclipse.ui,
@@ -29,5 +29,6 @@
com.nokia.carbide.cpp.pi,
com.nokia.carbide.cpp.pi.editors,
com.nokia.carbide.cpp.pi.importer,
- com.nokia.carbide.cpp.pi.visual
+ com.nokia.carbide.cpp.pi.visual,
+ com.nokia.carbide.cpp.pi.export
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/icons/PI_Meter_16x16.png has changed
Binary file sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/icons/PI_Meter_20x20.png has changed
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/plugin.xml Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/plugin.xml Wed Jun 23 15:05:09 2010 +0300
@@ -2,7 +2,7 @@
<?eclipse version="3.0"?>
<plugin>
<extension-point id="piPluginData" name="piPluginData" schema="schema/piPluginData.exsd"/>
-
+ <extension-point id="traceprovider" name="Trace Data Provider" schema="schema/traceprovider.exsd"/>
<extension
point="org.eclipse.ui.propertyPages">
<page
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/schema/traceprovider.exsd Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,98 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="com.nokia.carbide.cpp.pi" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="com.nokia.carbide.cpp.pi" id="traceprovider" name="Performance Investigator Trace Data Provider"/>
+ </appInfo>
+ <documentation>
+ This extension point can be used to provide trace data for Performance Investigator.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="traceprovider"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="traceprovider">
+ <complexType>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ Trace provider instance's class implementing ITraceProvider interface
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":com.nokia.carbide.cpp.pi.export.ITraceProvider"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="providerName" type="string" use="required">
+ <annotation>
+ <documentation>
+ Name of the trace provider instance
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 2.4.0
+ </documentation>
+ </annotation>
+
+
+
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ </documentation>
+ </annotation>
+
+</schema>
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/actions/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/actions/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.actions.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/AnalyserDataProcessor.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/AnalyserDataProcessor.java Wed Jun 23 15:05:09 2010 +0300
@@ -31,15 +31,9 @@
import java.util.List;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
@@ -63,7 +57,6 @@
import com.nokia.carbide.cpp.internal.pi.test.IProvideTraceAdditionalInfo;
import com.nokia.carbide.cpp.internal.pi.visual.GraphDrawRequest;
import com.nokia.carbide.cpp.internal.pi.visual.PICompositePanel;
-import com.nokia.carbide.cpp.pi.PiPlugin;
import com.nokia.carbide.cpp.pi.editors.PIPageEditor;
import com.nokia.carbide.cpp.pi.importer.SampleImporter;
import com.nokia.carbide.cpp.pi.util.GeneralMessages;
@@ -78,13 +71,13 @@
public class AnalyserDataProcessor {
protected static final int MAX_CPU = 4;
// whether the profile file was read correctly
- public static int STATE_OK = 0;
- public static int STATE_IMPORTING = 1;
- public static int STATE_OPENING = 2;
- public static int STATE_TIMESTAMP = 3;
- public static int STATE_CANCELED = 4;
- public static int STATE_INVALID = 5;
- public static int TOTAL_PROGRESS_COUNT = 10000;
+ public final static int STATE_OK = 0;
+ public final static int STATE_IMPORTING = 1;
+ public final static int STATE_OPENING = 2;
+ public final static int STATE_TIMESTAMP = 3;
+ public final static int STATE_CANCELED = 4;
+ public final static int STATE_INVALID = 5;
+ public final static int TOTAL_PROGRESS_COUNT = 10000;
static AnalyserDataProcessor instance = null;
@@ -385,68 +378,25 @@
};
-
-
try {
progressService.busyCursorWhile(runnableImportAndSave);
-
- final WorkspaceJob saveNpi = new WorkspaceJob (Messages.getString("AnalyserDataProcessor.savingImportedFile")) { //$NON-NLS-1$
+ final IRunnableWithProgress saveNpi = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ ProfileReader.getInstance().writeAnalysisFile(
+ analysisFile.getLocation().toString(), monitor,
+ null, uid);
- public IStatus runInWorkspace(IProgressMonitor monitor)
- throws CoreException {
- try {
- ProfileReader.getInstance().writeAnalysisFile(analysisFile.getLocation().toString(), monitor, null, uid);
- } catch (InvocationTargetException e) {
- return new Status(IStatus.ERROR, PiPlugin.PLUGIN_ID, Messages.getString("AnalyserDataProcessor.invocationTargetException"), e); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (InterruptedException e) {
- return new Status(IStatus.CANCEL, PiPlugin.PLUGIN_ID, Messages.getString("AnalyserDataProcessor.interruptedException"), e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return new Status(IStatus.OK, PiPlugin.PLUGIN_ID, Messages.getString("AnalyserDataProcessor.ok"), null); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- };
-
- progressService.busyCursorWhile(runnableOpen);
-
- saveNpi.setPriority(Job.DECORATE);
- saveNpi.addJobChangeListener(new IJobChangeListener () {
-
- public void aboutToRun(IJobChangeEvent event) {
}
- public void awake(IJobChangeEvent event) {
- }
-
- public void done(IJobChangeEvent event) {
- if (saveNpi.getResult().getSeverity() != IStatus.OK) {
- handleRunnableException (saveNpi.getResult().getException(), uid, analysisFile);
- }
- }
-
- public void running(IJobChangeEvent event) {
- }
-
- public void scheduled(IJobChangeEvent event) {
- }
-
- public void sleeping(IJobChangeEvent event) {
- }
-
- });
-
- saveNpi.schedule();
-
- if (pollTillNpiSaved) {
- while (saveNpi.getState() != Job.NONE) {
- // until it's done
- }
- }
-
+ };
+ progressService.busyCursorWhile(saveNpi);
+ progressService.busyCursorWhile(runnableOpen);
} catch (InvocationTargetException e) {
handleRunnableException(e, uid, analysisFile);
} catch (InterruptedException e) {
handleRunnableException(e, uid, analysisFile);
- }
+ }
}
public void importSave(final IFile analysisFile, final List<ITrace> pluginsToUse, String suffixTaskName, IProgressMonitor monitor) {
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/EventHandler.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/EventHandler.java Wed Jun 23 15:05:09 2010 +0300
@@ -26,7 +26,7 @@
-public class EventHandler
+public final class EventHandler
{
private static EventHandler instance = null;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.analyser.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/NpiInstanceRepository.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/NpiInstanceRepository.java Wed Jun 23 15:05:09 2010 +0300
@@ -303,7 +303,7 @@
private void assertLog(boolean cond, String message) {
if (!cond) {
- GeneralMessages.PiLog(message, IStatus.ERROR);
+ GeneralMessages.piLog(message, IStatus.ERROR);
}
}
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/PIChangeEvent.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/PIChangeEvent.java Wed Jun 23 15:05:09 2010 +0300
@@ -21,7 +21,7 @@
import com.nokia.carbide.cpp.pi.editors.PIPageEditor;
-public class PIChangeEvent {
+public final class PIChangeEvent {
private PIChangeEvent() {
/* this class can only have static method */
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/ProfileReader.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/ProfileReader.java Wed Jun 23 15:05:09 2010 +0300
@@ -80,7 +80,7 @@
* Class for reading a processed profile data file and setting up the
* editor pages, initial graphs, and initial tables
*/
-public class ProfileReader
+public final class ProfileReader
{
// objects (mainly traces) read, it's lifetime exist between loadAnalysisFile for last usage in loadAnalysisFile
static private ArrayList<Object> readObjects = new ArrayList<Object>();
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/StreamFileParser.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/StreamFileParser.java Wed Jun 23 15:05:09 2010 +0300
@@ -46,6 +46,7 @@
streamData = new byte[(int)streamFile.length()];
FileInputStream fis = new FileInputStream(streamFile);
fis.read(streamData);
+ fis.close();
readLoop();
}
@@ -160,7 +161,21 @@
dataBlocks.put(typeInt, baos);
}
- baos.write(streamData,readOffset,currentLength);
+
+ try {
+ baos.write(streamData,readOffset,currentLength);
+ baos.flush();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }finally{
+ if(baos != null){
+ try {
+ baos.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
readOffset += currentLength;
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/TestGUI.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/analyser/TestGUI.java Wed Jun 23 15:05:09 2010 +0300
@@ -26,7 +26,7 @@
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
-public class TestGUI extends Frame {
+public final class TestGUI extends Frame {
private static final long serialVersionUID = -7535470144323980407L;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/interfaces/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/interfaces/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.interfaces.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/BackgroundLoader.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/BackgroundLoader.java Wed Jun 23 15:05:09 2010 +0300
@@ -27,7 +27,7 @@
*
**/
-public class BackgroundLoader implements Runnable
+public final class BackgroundLoader implements Runnable
{
/**
* Thread used to load classes in the background
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.manager.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/PluginInitialiser.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/PluginInitialiser.java Wed Jun 23 15:05:09 2010 +0300
@@ -27,7 +27,7 @@
import com.nokia.carbide.cpp.pi.PiPlugin;
-public class PluginInitialiser
+public final class PluginInitialiser
{
/*
* contains vectors which are each mapped to hashcodes of analysis instances
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/PluginRegisterer.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/PluginRegisterer.java Wed Jun 23 15:05:09 2010 +0300
@@ -34,7 +34,7 @@
public class PluginRegisterer
{
- private static final String extensionName = "com.nokia.carbide.cpp.pi.piPluginData"; //$NON-NLS-1$
+ private static final String EXTENSION_NAME = "com.nokia.carbide.cpp.pi.piPluginData"; //$NON-NLS-1$
private static boolean alreadyRegistered = false;
@@ -66,7 +66,7 @@
}
IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = registry.getExtensionPoint(extensionName);
+ IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_NAME);
if (extensionPoint == null)
return;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/PluginRegistry.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/manager/PluginRegistry.java Wed Jun 23 15:05:09 2010 +0300
@@ -25,7 +25,7 @@
import com.nokia.carbide.cpp.pi.util.GeneralMessages;
-public class PluginRegistry
+public final class PluginRegistry
{
private static PluginRegistry pluginRegistry = null;
private Vector<AbstractPiPlugin> plugins;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/GenericSampledTrace.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/GenericSampledTrace.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,21 +17,35 @@
package com.nokia.carbide.cpp.internal.pi.model;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.Enumeration;
+import java.util.List;
import java.util.Vector;
public abstract class GenericSampledTrace extends GenericTrace
{
private static final long serialVersionUID = 5248402326692863890L;
+
+ /** highest sync time within samples */
private long lastSampleTime;
+ /** the samples */
public Vector<GenericSample> samples;
+ /**
+ * Constructor
+ */
public GenericSampledTrace()
{
this.samples = new Vector<GenericSample>();
}
+ /**
+ * Adds the given sample to the samples collection
+ * @param sample the sample to add
+ */
public void addSample(GenericSample sample)
{
this.samples.add(sample);
@@ -59,16 +73,31 @@
return lastSampleTime;
}
+ /**
+ * returns all samples as an enumeration
+ * @return
+ */
public Enumeration<GenericSample> getSamples()
{
return samples.elements();
}
+ /**
+ * Gets the nth element of the collection of samples
+ * @param number the index to look for
+ * @return the found sample (or ArrayIndexOutOfBoundsException)
+ */
public GenericSample getSample(int number)
{
return (GenericSample)this.samples.elementAt(number);
}
+ /**
+ * Returns samples inside the given time period (including the boundaries).
+ * @param start the start time at which to include samples
+ * @param end the end time at which to include samples
+ * @return samples included in the time period
+ */
public Vector<GenericSample> getSamplesInsideTimePeriod(long start, long end)
{
Enumeration<GenericSample> sEnum = samples.elements();
@@ -88,128 +117,55 @@
return okSamples;
}
-
- public GenericSample[] getSamplesForTime(long time)
- {
- // start the search from the middle of the sample set
- long location = this.samples.size() / 2;
-
- // next, add or remove 1/4 of the length of the sample set
- int div = 4;
-
- // boolean value indicating that the search proceeds now one step at a time
- boolean saturated = false;
+
+ /**
+ * Returns all samples with the given sync time
+ * @param time the time to look for
+ * @return array of samples for given sync time
+ */
+ public GenericSample[] getSamplesForTime(long time) {
+ List<GenericSample> resList = new ArrayList<GenericSample>();
- // search algorithm, proceed until a value is found or
- // reached the boundaries of the search area
-
- // note that the sample numbers MUST increase with growing
- // indices within the samples vector in order for this
- // algorithm to work!
- while (true)
- {
- // take the sample from the location
- GenericSample s = (GenericSample)samples.elementAt((int)location);
-
- // if the searched value is larger than the value at the proposed location
- // increment the proposed location with the length of the data set divided
- // by the divisor
- if (s.sampleSynchTime < time)
- {
- if (!saturated)
- {
- int change = this.samples.size() / div;
- if (change >= 1)
- {
- location += change;
- div *= 2;
- }
- else
- {
- saturated = true;
- }
- }
- else
- {
- // already saturated, go one step at a time
- location++;
- }
+ //find the sample just before the search result
+ GenericSample sample = new MockGenericSample();
+ sample.sampleSynchTime = time-1;
+ int pos = Collections.binarySearch(samples, sample, new Comparator<GenericSample>(){
+ public int compare(GenericSample s1, GenericSample s2) {
+ return (int)(s1.sampleSynchTime - s2.sampleSynchTime);
}
- // similarly, decrement the proposed location
- // if the value is smaller than the searched value
- else if (s.sampleSynchTime > time)
- {
- if (!saturated)
- {
- int change = this.samples.size() / div;
- if (change >= 1)
- {
- location -= change;
- div *= 2;
- }
- else
- {
- saturated = true;
- }
- }
- else
- {
- // already saturated, go one step at a time
- location--;
+ });
+
+ //go to the first match
+ pos = pos < 0 ? (-(pos)-1) : pos+1;
+
+ if (pos < samples.size()){
+ //collect matches
+ for (int i = pos; i < samples.size(); i++) {
+ GenericSample found = samples.elementAt(i);
+ if (found.sampleSynchTime > time){
+ break;
+ } else if (found.sampleSynchTime == time){
+ resList.add(found);
}
}
- else if (s.sampleSynchTime == time)
- {
- return this.getSamplesWithSameTimeFrom(location);
- }
-
- // reached the end of the sample set without a match
- if (location < 0 || location >= this.samples.size())
- return null;
- }
-
- }
-
- private GenericSample[] getSamplesWithSameTimeFrom(long location)
- {
- long sameTime = ((GenericSample)samples.elementAt((int)location)).sampleSynchTime;
- int lowBound = (int)location;
- int highBound = (int)location;
-
- if (lowBound-1 >=0)
- {
- // go backwards as long as there are samples with the same samplenumber
- while ( ((GenericSample)samples.elementAt(lowBound - 1)).sampleSynchTime == sameTime
- && (lowBound - 1) >= 0)
- {
- lowBound--;
- }
}
- if (highBound + 1 < this.samples.size())
- {
- // go backwards as long as there are samples with the same samplenumber
- while ( ((GenericSample)samples.elementAt(highBound + 1)).sampleSynchTime == sameTime
- && (highBound + 1) < this.samples.size())
- {
- highBound++;
- }
- }
-
- GenericSample[] sa = new GenericSample[highBound - lowBound + 1];
- for (int i = 0; i < sa.length; i++)
- {
- sa[i] = (GenericSample)samples.elementAt(lowBound + i);
- }
-
- return sa;
- }
+ return resList.toArray(new GenericSample[resList.size()]);
+ }
+ /**
+ * Returns the overall number of samples
+ * @return
+ */
public int getSampleAmount()
{
return this.samples.size();
}
+ /**
+ * Returns the sync time of the first sample, or 0.
+ * @return
+ */
public int getFirstSampleNumber()
{
if (this.samples.size() > 0)
@@ -228,6 +184,9 @@
return (int)getLastSampleTime();
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
public String toString()
{
Enumeration<GenericSample> sEnum = this.getSamples();
@@ -259,4 +218,10 @@
String total = new String(bytes);
return total;
}
+
+ // this class is only needed for binary search
+ @SuppressWarnings("serial")
+ class MockGenericSample extends GenericSample {
+ }
+
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/ICPUScale.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.carbide.cpp.internal.pi.model;
+
+public interface ICPUScale {
+
+ /**
+ * Calculate a percentage value (0 - 1) of the CPU clock at given time
+ *
+ * @param sampleSynchTime
+ * @return the calculated value
+ */
+ public float calculateScale(int sampleSynchTime);
+
+ /**
+ * Calculate a percentage value (0 - 1) of the CPU clock at given time period
+ *
+ * @param startSynchTime
+ * @param endSynchTime
+ * @return the calculated value
+ */
+ public float calculateScale(int startSynchTime, int endSynchTime);
+
+ /**
+ * Check whether CPU scale supported or not
+ *
+ * @return <code>true</code> is returned if CPU scale is supported or
+ * <code>false</code> if is not
+ */
+ public boolean isCpuScaleSupported();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/ICPUScaleAdapter.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.carbide.cpp.internal.pi.model;
+
+import org.eclipse.core.runtime.IAdaptable;
+
+public interface ICPUScaleAdapter extends IAdaptable{
+
+}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.model.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/PiManager.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/PiManager.java Wed Jun 23 15:05:09 2010 +0300
@@ -21,7 +21,7 @@
-public class PiManager {
+public final class PiManager {
private static PiManager manager;
private PiManager() {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/PluginTrace.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.carbide.cpp.internal.pi.model;
+
+import java.io.File;
+
+import com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace;
+
+public class PluginTrace implements ITrace {
+
+ private int traceId;
+ private String traceName;
+ private String traceDescription;
+ private String traceTitle;
+ private boolean mandatory;
+
+
+ public void setTraceId(int traceId) {
+ this.traceId = traceId;
+ }
+
+ public int getTraceId() {
+ return traceId;
+ }
+
+ public void setTraceName(String traceName) {
+ this.traceName = traceName;
+ }
+
+ public String getTraceName() {
+ return traceName;
+ }
+
+ public void setTraceDescription(String traceDescription) {
+ this.traceDescription = traceDescription;
+ }
+
+ public String getTraceDescription() {
+ return traceDescription;
+ }
+
+ public void setMandatory(boolean mandatory) {
+ this.mandatory = mandatory;
+ }
+
+ public boolean isMandatory() {
+ return mandatory;
+ }
+
+ public void setTraceTitle(String traceTitle) {
+ this.traceTitle = traceTitle;
+ }
+
+ public String getTraceTitle() {
+ return traceTitle;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Class getTraceClass() {
+ return null;
+ }
+
+ public void initialiseTrace(GenericTrace trace) {
+
+ }
+
+ public ParsedTraceData parseTraceFile(File file) throws Exception {
+ return null;
+ }
+
+ public ParsedTraceData parseTraceFiles(File[] files) throws Exception {
+ return null;
+ }
+
+}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/ProfiledGeneric.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/ProfiledGeneric.java Wed Jun 23 15:05:09 2010 +0300
@@ -308,14 +308,8 @@
* @return
*/
public float[] getActivityList(){
- if (activityP != null){
- //Arrays.copyOf() is only supported from Java 6
- //return Arrays.copyOf(this.activityP, this.activityP.length);
- float[] ret = new float[activityP.length];
- for (int i = 0; i < ret.length; i++) {
- ret[i] = activityP[i];
- }
- return ret;
+ if (activityP != null){
+ return activityP.clone();
}
return null;
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/ProfiledThread.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/ProfiledThread.java Wed Jun 23 15:05:09 2010 +0300
@@ -19,19 +19,21 @@
import java.io.Serializable;
-/*
- *
- * PRI HOMMAT KOMMENTOITU TÄSTÄ FILESTÄ TOISTAISEKSI
- *
- */
+import org.eclipse.core.runtime.Platform;
-public class ProfiledThread extends ProfiledGeneric implements Serializable
+import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
+import com.nokia.carbide.cpp.pi.PiPlugin;
+
+
+public class ProfiledThread extends ProfiledGeneric implements Serializable, ICPUScaleAdapter
{
private static final long serialVersionUID = 20150633093396772L;
private char name; //char symbol of the thread
private int threadId; //thread's real id
+
+ private float[] calculatedActivity;
public ProfiledThread(int cpuCount, int graphCount)
{
@@ -70,4 +72,66 @@
{
this.threadId = threadId;
}
+
+ /* (non-Javadoc)
+ * @see com.nokia.carbide.cpp.internal.pi.model.ProfiledGeneric#getActivityList()
+ */
+ @Override
+ public float[] getActivityList() {
+ float[] activityList = super.getActivityList();
+
+ boolean scaleCPU = isScaledCpu();
+ if(scaleCPU){
+ Object object = getAdapter(ICPUScale.class);
+ if(object instanceof ICPUScale){
+ ICPUScale cpuScale = (ICPUScale) object;
+ if(calculatedActivity != null && calculatedActivity.length == activityList.length){
+ activityList = calculatedActivity;
+ }else{
+ int[] sampleList = getSampleList();
+ for (int i = 0; i < sampleList.length; i++) {
+ float value = activityList[i] / 100;
+ value = value * cpuScale.calculateScale(sampleList[i]) * 100;
+ activityList[i] = value;
+ }
+ calculatedActivity = activityList;
+ }
+ }
+ }
+
+ return activityList;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if(adapter == null){
+ return null;
+ }
+ return Platform.getAdapterManager().loadAdapter(this, adapter.getName());
+ }
+
+ /**
+ * Check are threads scaled or not
+ *
+ * @return
+ */
+ public boolean isScaledCpu(){
+ boolean scaleCPU = false;
+
+ Object obj = NpiInstanceRepository.getInstance().activeUidGetPersistState(
+ PiPlugin.ACTION_SCALE_CPU);
+ if ((obj != null) && (obj instanceof Boolean)){
+ // retrieve the current value
+ scaleCPU = (Boolean) obj;
+ }else{
+ // set the initial value
+ NpiInstanceRepository.getInstance().activeUidSetPersistState(
+ PiPlugin.ACTION_SCALE_CPU, scaleCPU);
+ }
+ return scaleCPU;
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/TraceDataRepository.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/model/TraceDataRepository.java Wed Jun 23 15:05:09 2010 +0300
@@ -23,7 +23,7 @@
import java.util.LinkedHashMap;
import java.util.Vector;
-public class TraceDataRepository
+public final class TraceDataRepository
{
private static Hashtable<Integer,LinkedHashMap<Class,ParsedTraceData>> analysisSpecificTraces;
private static TraceDataRepository instance;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/perspectives/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/perspectives/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.perspectives.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/plugin/model/IAnalysisSpecificMenu.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/plugin/model/IAnalysisSpecificMenu.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,7 +17,7 @@
package com.nokia.carbide.cpp.internal.pi.plugin.model;
-public abstract interface IAnalysisSpecificMenu extends IMenu
+public interface IAnalysisSpecificMenu extends IMenu
{
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/plugin/model/IMenu.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/plugin/model/IMenu.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,7 +17,7 @@
package com.nokia.carbide.cpp.internal.pi.plugin.model;
-public abstract interface IMenu
+public interface IMenu
{
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/plugin/model/ITrace.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/plugin/model/ITrace.java Wed Jun 23 15:05:09 2010 +0300
@@ -30,6 +30,8 @@
public String getTraceName();
/** like trace name but can be more descriptive */
public String getTraceTitle();
+ public boolean isMandatory();
+ public String getTraceDescription();
public int getTraceId();
public ParsedTraceData parseTraceFile(File file /*, ProgressBar progressBar*/) throws Exception;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/properties/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/properties/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.properties.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/resolvers/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/resolvers/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.resolvers.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/resolvers/SymbolFileFunctionResolver.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/resolvers/SymbolFileFunctionResolver.java Wed Jun 23 15:05:09 2010 +0300
@@ -182,11 +182,11 @@
if (br != null)
br.close();
} catch (FileNotFoundException e) {
- GeneralMessages.PiLog(Messages.getString("SymbolFileFunctionResolver.symbol.file1") + symbolFile + Messages.getString("SymbolFileFunctionResolver.not.found"), GeneralMessages.ERROR); //$NON-NLS-1$ //$NON-NLS-2$
+ GeneralMessages.piLog(Messages.getString("SymbolFileFunctionResolver.symbol.file1") + symbolFile + Messages.getString("SymbolFileFunctionResolver.not.found"), GeneralMessages.ERROR); //$NON-NLS-1$ //$NON-NLS-2$
} catch (IOException e) {
String myMessage = Messages.getString("SymbolFileFunctionResolver.symbol.file2") + symbolFile + Messages.getString("SymbolFileFunctionResolver.ioexception"); //$NON-NLS-1$ //$NON-NLS-2$
GeneralMessages.showErrorMessage(myMessage);
- GeneralMessages.PiLog(myMessage, GeneralMessages.ERROR);
+ GeneralMessages.piLog(myMessage, GeneralMessages.ERROR);
}
// this breaks the symbol file parser, use for testing itt trace
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/save/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/save/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.save.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/test/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/test/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.test.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/utils/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/utils/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.utils.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/visual/GenericTable.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/visual/GenericTable.java Wed Jun 23 15:05:09 2010 +0300
@@ -102,6 +102,9 @@
protected static final String COLUMN_HEAD_LIBRARY_NAME = Messages.getString("GenericTable.libraryName"); //$NON-NLS-1$
protected static final String COLUMN_HEAD_LIBRARY_LOAD_SIZE = Messages.getString("GenericTable.libraryLoadSize"); //$NON-NLS-1$
protected static final String COLUMN_HEAD_LIBRARY_SELECTION_LOAD_COUNT = Messages.getString("GenericTable.librarySelectionLoadCount"); //$NON-NLS-1$
+ protected static final String COLUMN_HEAD_GRAPHICS_MEMORY_NAME = Messages.getString("GenericTable.process"); //$NON-NLS-1$
+ protected static final String COLUMN_HEAD_GRAPHICS_MEMORY_PRIVATE = Messages.getString("GenericTable.private"); //$NON-NLS-1$
+ protected static final String COLUMN_HEAD_GRAPHICS_MEMORY_SHARED = Messages.getString("GenericTable.shared"); //$NON-NLS-1$
// table column widths
protected static final int COLUMN_WIDTH_SHOW = 40;
@@ -122,8 +125,11 @@
protected static final int COLUMN_WIDTH_8_DIGIT_HEX = 100;
protected static final int COLUMN_WIDTH_MEMORY_CHUNKS = 80;
protected static final int COLUMN_WIDTH_MEMORY_STACK = 80;
+ protected static final int COLUMN_WIDTH_GRAPHICS_MEMORY_PRIVATE = 80;
+ protected static final int COLUMN_WIDTH_GRAPHICS_MEMORY_SHARED = 80;
protected static final int COLUMN_WIDTH_MEMORY_TOTAL = 80;
protected static final int COLUMN_WIDTH_MEMORY_NAME = 300;
+ protected static final int COLUMN_WIDTH_GRAPHICS_MEMORY_NAME = 300;
protected static final int COLUMN_WIDTH_THREAD_IRQ_LINE = 300;
protected static final int COLUMN_WIDTH_LIBRARY_LOAD_SIZE = 80;
protected static final int COLUMN_WIDTH_LIBRARY_NAME = 250;
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/visual/GraphComposite.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/visual/GraphComposite.java Wed Jun 23 15:05:09 2010 +0300
@@ -547,6 +547,10 @@
public void widgetDefaultSelected(SelectionEvent e) {
// No actions needed here
}
+
+ public Combo getTitleBarCombo(){
+ return comboGraphType;
+ }
/*
* (non-Javadoc)
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/visual/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/visual/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.internal.pi.visual.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/visual/PIVisualSharedData.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/visual/PIVisualSharedData.java Wed Jun 23 15:05:09 2010 +0300
@@ -23,10 +23,10 @@
// String, Integer, Long, etc.
// Do not add instances of any application specific class
- public String[] GPP_SelectedThreadNames;
- public String[] GPP_SelectedBinaryNames;
- public String[] GPP_SelectedFunctionNames;
- public int[] GPP_SelectedThreadIndicies;
- public int[] GPP_SelectedBinariesIndicies;
- public int[] GPP_SelectedFunctionIndicies;
+ public String[] gppSelectedThreadNames;
+ public String[] gppSelectedBinaryNames;
+ public String[] gppSelectedFunctionNames;
+ public int[] gppSelectedThreadIndicies;
+ public int[] gppSelectedBinariesIndicies;
+ public int[] gppSelectedFunctionIndicies;
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/visual/messages.properties Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/visual/messages.properties Wed Jun 23 15:05:09 2010 +0300
@@ -3,6 +3,7 @@
GenericTraceGraph.setTimeScaleTo=Time scale set to:
GenericTable.pathOfBinary=Path of Binary
GenericTable.threadProcess=Thread/Chunk
+GenericTable.process=Process
GenericTable.sortByInPath=Sort by Binary Path, then Binary Name
GenericTable.checkHighlighted=Check Highlighted Rows
GenericTable.uncheckHighlighted=Uncheck Highlighted Rows
@@ -13,6 +14,7 @@
GenericTable.inBinary=In Binary
GenericTable.startAddr=Function Start
GenericTable.stackHeap=Stack/Heap
+GenericTable.shared=Shared
GenericTable.selectAll=Select All\tCtrl+A
GenericTable.priority=Priority List
GenericTable.sortByPath=Sort by Binary Path, then Binary Name
@@ -28,6 +30,7 @@
GenericTable.thread=Thread
GenericTable.binary=Binary
GenericTable.chunks=Chunks
+GenericTable.private=Private
GenericTable.show=
GenericTable.libraryLoadSize=Load Size
GenericTable.libraryName=Loaded Library
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/PiPlugin.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/PiPlugin.java Wed Jun 23 15:05:09 2010 +0300
@@ -17,8 +17,15 @@
package com.nokia.carbide.cpp.pi;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
import org.osgi.framework.BundleContext;
import com.nokia.carbide.cpp.internal.pi.model.Binary;
@@ -37,6 +44,8 @@
import com.nokia.carbide.cpp.internal.pi.test.EnabledTrace;
import com.nokia.carbide.cpp.internal.pi.test.PIAnalysisInfo;
import com.nokia.carbide.cpp.internal.pi.test.TraceAdditionalInfo;
+import com.nokia.carbide.cpp.pi.export.ITraceProvider;
+
/**
@@ -48,6 +57,19 @@
private static PiPlugin plugin;
public final static String PLUGIN_ID = "com.nokia.carbide.cpp.pi"; //$NON-NLS-1$
+ public final static String ACTION_SCALE_CPU = PLUGIN_ID + ".scaleCPU"; //$NON-NLS-1$
+
+ /**
+ * Trace provider extension name.
+ */
+ final String EXTENSION_TRACE_PROVIDER = "traceprovider"; //$NON-NLS-1$
+
+ /**
+ * Storing reference to possibly installed trace provider plug-in.
+ */
+ private static ITraceProvider traceProvider;
+
+
private static void setPlugin(PiPlugin localPlugin) {
plugin = localPlugin;
@@ -65,6 +87,9 @@
*/
public void start(BundleContext context) throws Exception {
super.start(context);
+
+ // Getting installed trace provider plug-in if available
+ traceProvider = findTraceProviderExtension();
}
/**
@@ -109,6 +134,7 @@
return getDefault().getImageRegistry().get(aLocation);
}
+ @SuppressWarnings("unchecked")
public static Class getReplacedClass(String className) {
// handle legacy PI analysis file class names
if (!className.startsWith("fi.")) //$NON-NLS-1$
@@ -175,4 +201,81 @@
return null;
}
+
+ /**
+ * This must be called from UI thread. If called
+ * from non-ui thread this returns <code>null</code>.
+ * @return Currently active workbench page.
+ */
+ public static IWorkbenchPage getCurrentlyActivePage(){
+ return getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ }
+
+ /**
+ * This must be called from UI thread. If called
+ * from non-UI thread this returns <code>null</code>.
+ * @return The shell of the currently active workbench window..
+ */
+ public static Shell getCurrentlyActiveWbWindowShell(){
+ IWorkbenchPage page = getCurrentlyActivePage();
+ if(page != null){
+ return page.getWorkbenchWindow().getShell();
+ }
+ return null;
+ }
+
+ /**
+ * Checks if trace provider plug-in is available.
+ * @return <code>true</code> if trace provider interface available, otherwise <code>false</code>
+ */
+ public static boolean isTraceProviderAvailable(){
+ return (traceProvider != null);
+ }
+
+ /**
+ * Gets trace provider interface instance if available.
+ * @return trace provider interface instance or <code>null</code> if not available
+ */
+ public static ITraceProvider getTraceProvider(){
+ if(isTraceProviderAvailable()){
+ return traceProvider;
+ }
+ return null;
+ }
+
+ /**
+ * Tries to find trace provider plug-ins. Selecting the first found one.
+ * @return reference to trace provider instance if found, otherwise <code>null</code>
+ */
+ ITraceProvider findTraceProviderExtension() {
+ try {
+ IExtensionRegistry er = Platform.getExtensionRegistry();
+ IExtensionPoint ep = er.getExtensionPoint(PLUGIN_ID, EXTENSION_TRACE_PROVIDER);
+ IExtension[] extensions = ep.getExtensions();
+
+ // if plug-ins were found.
+ if (extensions != null && extensions.length > 0) {
+
+ // read all found trace providers
+ for (int i = 0; i < extensions.length; i++) {
+ IConfigurationElement[] ce = extensions[i].getConfigurationElements();
+ if (ce != null && ce.length > 0) {
+ try {
+ ITraceProvider provider = (ITraceProvider)ce[0].createExecutableExtension("class"); //$NON-NLS-1$
+ // We support only one trace provider
+ if (provider != null) {
+ return provider;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/editors/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/editors/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.editors.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/editors/PIPageEditor.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/editors/PIPageEditor.java Wed Jun 23 15:05:09 2010 +0300
@@ -94,14 +94,14 @@
public static final String PI_ID = "com.nokia.carbide.cpp.pi"; //$NON-NLS-1$
// PI menu groups for adding plug-in specific actions/menu items
- public static final String includeFilesGroup = "includeFile"; //$NON-NLS-1$
- public static final String reportsGroup = "reports"; //$NON-NLS-1$
- public static final String viewOptionsGroup = "viewOptions"; //$NON-NLS-1$
- public static final String exportsGroup = "exports"; //$NON-NLS-1$
- public static final String additionsGroup = "additions"; //$NON-NLS-1$
+ public static final String INCLUDE_FILES_GROUP = "includeFile"; //$NON-NLS-1$
+ public static final String REPORTS_GROUP = "reports"; //$NON-NLS-1$
+ public static final String VIEW_OPTIONS_GROUP = "viewOptions"; //$NON-NLS-1$
+ public static final String EXPORTS_GROUP = "exports"; //$NON-NLS-1$
+ public static final String ADDITIONS_GROUP = "additions"; //$NON-NLS-1$
// PI menu identifier
- public static final String menuID = "com.nokia.carbide.cpp.pi.menuID"; //$NON-NLS-1$
+ public static final String MENU_ID = "com.nokia.carbide.cpp.pi.menuID"; //$NON-NLS-1$
// indices of the three standard pages that have graphs
public static final int THREADS_PAGE = 0;
@@ -457,11 +457,11 @@
* CPU Load Graph ->
* -----------------------------
*/
- currentManager.add(new Separator(PIPageEditor.includeFilesGroup));
- currentManager.add(new Separator(PIPageEditor.reportsGroup));
- currentManager.add(new Separator(PIPageEditor.viewOptionsGroup));
- currentManager.add(new Separator(PIPageEditor.exportsGroup));
- currentManager.add(new Separator(PIPageEditor.additionsGroup));
+ currentManager.add(new Separator(PIPageEditor.INCLUDE_FILES_GROUP));
+ currentManager.add(new Separator(PIPageEditor.REPORTS_GROUP));
+ currentManager.add(new Separator(PIPageEditor.VIEW_OPTIONS_GROUP));
+ currentManager.add(new Separator(PIPageEditor.EXPORTS_GROUP));
+ currentManager.add(new Separator(PIPageEditor.ADDITIONS_GROUP));
}
});
@@ -471,15 +471,15 @@
if (action == null)
return;
- currentManager.appendToGroup(PIPageEditor.exportsGroup, action);
+ currentManager.appendToGroup(PIPageEditor.EXPORTS_GROUP, action);
}
public static void addIncludeAction(IAction action) {
if (action == null)
return;
- if (currentManager.find(menuID + Messages.getString("PIPageEditor.includeActionEnding")) == null) { //$NON-NLS-1$
- includeManager = new MenuManager(Messages.getString("PIPageEditor.includeOtherFile"), menuID + Messages.getString("PIPageEditor.includeActionEnding")); //$NON-NLS-1$ //$NON-NLS-2$
+ if (currentManager.find(MENU_ID + Messages.getString("PIPageEditor.includeActionEnding")) == null) { //$NON-NLS-1$
+ includeManager = new MenuManager(Messages.getString("PIPageEditor.includeOtherFile"), MENU_ID + Messages.getString("PIPageEditor.includeActionEnding")); //$NON-NLS-1$ //$NON-NLS-2$
currentManager.add(includeManager);
}
@@ -490,14 +490,14 @@
if (action == null)
return;
- currentManager.appendToGroup(PIPageEditor.reportsGroup, action);
+ currentManager.appendToGroup(PIPageEditor.REPORTS_GROUP, action);
}
public static void addReportManager(IMenuManager menuManager) {
if (menuManager == null)
return;
- currentManager.appendToGroup(PIPageEditor.reportsGroup, menuManager);
+ currentManager.appendToGroup(PIPageEditor.REPORTS_GROUP, menuManager);
}
public static void addViewOptionManager(IMenuManager menuManager) {
@@ -507,7 +507,7 @@
if (menuManager == currentManager)
return;
- currentManager.appendToGroup(PIPageEditor.viewOptionsGroup, menuManager);
+ currentManager.appendToGroup(PIPageEditor.VIEW_OPTIONS_GROUP, menuManager);
}
/**
@@ -916,16 +916,13 @@
delta = delta.findMember(editorPath);
if (delta != null) {
int deltaKind = delta.getKind();
- switch(deltaKind) {
- case IResourceDelta.REMOVED:
- case IResourceDelta.REMOVED_PHANTOM:
+ if(deltaKind == IResourceDelta.REMOVED || deltaKind == IResourceDelta.REMOVED_PHANTOM){
Display.getDefault().syncExec(new Runnable() {
public void run() {
PIPageEditor.this.getSite().getPage().closeEditor(PIPageEditor.this, false);
}
- });
- break;
- }
+ });
+ }
}
}
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/editors/PIPageEditorContributor.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/editors/PIPageEditorContributor.java Wed Jun 23 15:05:09 2010 +0300
@@ -59,7 +59,7 @@
if (piManager != null) {
piManager.dispose();
}
- piManager = new MenuManager(Messages.getString("PIPageEditorContributor.PerformanceInvestigator"), PIPageEditor.menuID); //$NON-NLS-1$
+ piManager = new MenuManager(Messages.getString("PIPageEditorContributor.PerformanceInvestigator"), PIPageEditor.MENU_ID); //$NON-NLS-1$
manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, piManager);
PIPageEditor.setPIMenuManager(piManager);
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/export/ITraceClientNotificationsIf.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.carbide.cpp.pi.export;
+
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Callback interface reporting trace related error information from trace source side.
+ */
+public interface ITraceClientNotificationsIf {
+
+ /**
+ * Notifies informative message from trace source.
+ * @param message message
+ */
+ public void notifyInformation(String message);
+
+ /**
+ * Notifies warning from trace source.
+ * @param message message
+ */
+ public void notifyWarning(String message);
+
+ /**
+ * Notifies error from trace source.
+ * @param message message
+ */
+ public void notifyError(String message);
+
+ /**
+ * Update trace data file during tracing
+ *
+ * @param path of the trace data file
+ * @param time of the used time to trace
+ * @param size of the trace data file
+ */
+ public void updateTraceDataFile(IPath path, long time, long size);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/export/ITraceProvider.java Wed Jun 23 15:05:09 2010 +0300
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.carbide.cpp.pi.export;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace;
+
+/**
+ * Interface for binding external trace data providers for Performance
+ * Investigator. Only a single trace data provider instance at a time is
+ * supported. In case more that a single trace data providers are available the
+ * selection among them is undeterministic.
+ */
+public interface ITraceProvider {
+
+ public final static String DAT_FILE = "dat"; //$NON-NLS-1$
+ public final static String BASE_FILE = "base64"; //$NON-NLS-1$
+ public final static String BASE_CORRUPTED_FILE = "corrupted_base64"; //$NON-NLS-1$
+
+
+ /**
+ * Get available list of the plug-ins from the device
+ *
+ * @param traceClient instance of the ITraceClientNotificationsIf
+ * @param monitor
+ * instance of the {@link IProgressMonitor}
+ * @return list of the available plug-ins
+ * @throws CoreException
+ */
+ public List<ITrace> getAvailableSamplers(ITraceClientNotificationsIf traceClient, IProgressMonitor monitor)
+ throws CoreException;
+
+
+ /**
+ * Gets preference page ID for the user trace source.
+ *
+ * @return preference page ID for the user trace source
+ */
+ public String getTraceSourcePreferencePageId();
+
+ /**
+ * Gets current connections display name.
+ *
+ * @return current connections display name
+ */
+ public String getDisplayNameForCurrentConnection(IProgressMonitor monitor)
+ throws CoreException;
+
+ /**
+ * Start to trace data from device
+ *
+ * @param filePrefix profiler data file's prefix
+ * @param traceIds plug-in IDs to trace
+ * @param traceClient instance of the ITraceClientNotificationsIf
+ * @param monitor instance of the {@link IProgressMonitor}
+ * @throws CoreException
+ */
+ public void startTrace(String filePrefix, int[] traceIds,
+ ITraceClientNotificationsIf traceClient, IProgressMonitor monitor)
+ throws CoreException;
+
+ /**
+ * Stop the trace
+ *
+ * @param forceStop do force stop
+ * @return location where the trace data file is located
+ * @throws CoreException
+ */
+ public IPath stopTrace(boolean forceStop) throws CoreException;
+
+
+ /**
+ * Check is listener activated
+ *
+ * @return the listener activation status
+ */
+ public boolean isListening();
+}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/importer/Messages.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/importer/Messages.java Wed Jun 23 15:05:09 2010 +0300
@@ -20,7 +20,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-public class Messages {
+public final class Messages {
private static final String BUNDLE_NAME = "com.nokia.carbide.cpp.pi.importer.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/importer/SampleImporter.java Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/importer/SampleImporter.java Wed Jun 23 15:05:09 2010 +0300
@@ -31,6 +31,7 @@
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.ui.PlatformUI;
@@ -84,6 +85,9 @@
private boolean bupMapIsBuiltIn;
private boolean bupMapIsWorkspace;
+ private boolean profilerActivator;
+
+
private SampleImporter() {
clear();
// singleton
@@ -341,6 +345,7 @@
clearBupMapSymbianSDKId ();
clearBupMapIsBuiltIn ();
clearBupMapIsWorkspace ();
+ profilerActivator = false;
}
public boolean validate () {
@@ -436,15 +441,30 @@
return;
}
}
-
-
- // import the new project according to wizard
- piFileName = new Path(getDatFileName()).removeFileExtension().addFileExtension("npi").lastSegment(); //$NON-NLS-1$
+ // allow to set specific npi file name that is used from the JUnit test cases
+ boolean piFileNameForced = false;
+ if(piFileName.length() == 0){
+ // import the new project according to wizard
+ piFileName = new Path(getDatFileName()).removeFileExtension().addFileExtension("npi").lastSegment(); //$NON-NLS-1$
+ }else{
+ piFileNameForced = true;
+ }
piFile = piContainer.getFile(new Path(piFileName));
+
if (piFile.exists())
{
- piFile = piContainer.getFile(new Path(generateNpiFileName(piContainer, piFileName)));
+ if(piFileNameForced){
+ try {
+ piFile.delete(true, null);
+ } catch (CoreException e) {
+ GeneralMessages.showErrorMessage(com.nokia.carbide.cpp.pi.importer.Messages.getString("SampleImporter.importerInternalError")); //$NON-NLS-1$
+ GeneralMessages.piLog(com.nokia.carbide.cpp.pi.importer.Messages.getString("SampleImporter.importerCoreException"), GeneralMessages.ERROR); //$NON-NLS-1$
+ return;
+ }
+ }else{
+ piFile = piContainer.getFile(new Path(generateNpiFileName(piContainer, piFileName)));
+ }
}
// import and save the file as npi
@@ -453,7 +473,15 @@
}else{
AnalyserDataProcessor.getInstance().importSave(piFile, pluginsInTraceFile, suffixTaskName, progressMonitor);
}
-
+ if(profilerActivator){
+ IPath datPath = new Path(getDatFileName());
+ IPath piPath = piFile.getLocation();
+ piPath = piPath.removeFileExtension().addFileExtension(datPath.getFileExtension());
+ if(!datPath.toFile().renameTo(piPath.toFile())){
+ GeneralMessages.piLog(Messages.getString("SampleImporter.failedToMoveProfilerDataFile"), GeneralMessages.INFO); //$NON-NLS-1$
+ }
+
+ }
if (dummySymbol != null) {
if(getRomSymbolFile().equals(dummySymbol.toString())){
dummySymbol.delete();
@@ -468,7 +496,7 @@
initialFilename = new java.io.File(initialFilename).getName();
String baseName;
- Long suffixNumber = new Long(0);
+ Long suffixNumber = Long.valueOf(0);
int dot = initialFilename.lastIndexOf("."); //$NON-NLS-1$
if (dot > 1) {
@@ -556,4 +584,10 @@
setStripTimeStampDone();
}
+ public void setProfilerActivator(boolean profilerActivator){
+ this.profilerActivator = profilerActivator;
+ }
+ public boolean isProfilerActivator(){
+ return profilerActivator;
+ }
}
--- a/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/importer/messages.properties Wed Jun 23 14:49:59 2010 +0300
+++ b/sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/pi/importer/messages.properties Wed Jun 23 15:05:09 2010 +0300
@@ -1,3 +1,4 @@
SampleImporter.0=Import failed:
+SampleImporter.failedToMoveProfilerDataFile=Failed to move profiler data file to correct location
SampleImporter.importerInternalError=Importer internal error
SampleImporter.importerCoreException=Importer CoreException