forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.5'
Change-Id: I32715e2fdbb14e4fccc4c58d3fd6052d7c1127f3
This commit is contained in:
BIN
doc/images/qtcreator-cpu-usage-analyzer-flamegraph.png
Normal file
BIN
doc/images/qtcreator-cpu-usage-analyzer-flamegraph.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 137 KiB |
BIN
doc/images/qtcreator-cpu-usage-analyzer-load-perf-trace.png
Normal file
BIN
doc/images/qtcreator-cpu-usage-analyzer-load-perf-trace.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
doc/images/qtcreator-cpu-usage-analyzer-settings.png
Normal file
BIN
doc/images/qtcreator-cpu-usage-analyzer-settings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
BIN
doc/images/qtcreator-cpu-usage-analyzer-statistics.png
Normal file
BIN
doc/images/qtcreator-cpu-usage-analyzer-statistics.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 127 KiB |
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -43,16 +43,19 @@
|
|||||||
used to analyze the CPU usage of an application on embedded devices and, to
|
used to analyze the CPU usage of an application on embedded devices and, to
|
||||||
a limited extent, on Linux desktop platforms. The CPU Usage Analyzer uses
|
a limited extent, on Linux desktop platforms. The CPU Usage Analyzer uses
|
||||||
the Perf tool bundled with the Linux kernel to take periodic snapshots of
|
the Perf tool bundled with the Linux kernel to take periodic snapshots of
|
||||||
the call chain of an application and visualizes them in a timeline view.
|
the call chain of an application and visualizes them in a timeline view or
|
||||||
|
as a flame graph.
|
||||||
|
|
||||||
\section1 Using the CPU Usage Analyzer
|
\section1 Using the CPU Usage Analyzer
|
||||||
|
|
||||||
The CPU Usage Analyzer needs to be able to locate debug symbols for the
|
The CPU Usage Analyzer usually needs to be able to locate debug symbols for
|
||||||
binaries involved. For debug builds, debug symbols are always generated.
|
the binaries involved.
|
||||||
Edit the project build settings to generate debug symbols also for release
|
|
||||||
builds.
|
|
||||||
|
|
||||||
To use the CPU Usage Analyzer:
|
Profile builds produce optimized binaries with separate debug symbols and
|
||||||
|
should generally be used for profiling.
|
||||||
|
|
||||||
|
To manually set up a build configuration to provide separate debug symbols,
|
||||||
|
edit the project build settings:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li To generate debug symbols also for applications compiled in release
|
\li To generate debug symbols also for applications compiled in release
|
||||||
@@ -60,23 +63,29 @@
|
|||||||
\uicontrol Details next to \uicontrol {Build Steps} to view the
|
\uicontrol Details next to \uicontrol {Build Steps} to view the
|
||||||
build steps.
|
build steps.
|
||||||
|
|
||||||
\li Select the \uicontrol {Generate separate debug info} check box, and
|
\li Select the \uicontrol {Generate separate debug info} check box.
|
||||||
then select \uicontrol Yes to recompile the project.
|
|
||||||
|
|
||||||
\li Select \uicontrol {Analyze > CPU Usage Analyzer} to profile the
|
\li Select \uicontrol Yes to recompile the project.
|
||||||
current application.
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
You can start the CPU Usage Analyzer in the following ways:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li Select \uicontrol Analyze > \uicontrol {CPU Usage Analyzer} to
|
||||||
|
profile the current application.
|
||||||
|
|
||||||
\li Select the
|
\li Select the
|
||||||
\inlineimage qtcreator-analyze-start-button.png
|
\inlineimage qtcreator-analyze-start-button.png
|
||||||
(\uicontrol Start) button to start the application from the
|
(\uicontrol Start) button to start the application from the
|
||||||
CPU Usage Analyzer.
|
CPU Usage Analyzer.
|
||||||
|
|
||||||
\note If data collection does not start automatically, select the
|
|
||||||
\inlineimage recordfill.png
|
|
||||||
(\uicontrol {Collect profile data}) button.
|
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
\note If data collection does not start automatically, select the
|
||||||
|
\inlineimage recordfill.png
|
||||||
|
(\uicontrol {Collect profile data}) button.
|
||||||
|
|
||||||
When you start analyzing an application, the application is launched, and
|
When you start analyzing an application, the application is launched, and
|
||||||
the CPU Usage Analyzer immediately begins to collect data. This is indicated
|
the CPU Usage Analyzer immediately begins to collect data. This is indicated
|
||||||
by the time running in the \uicontrol Recorded field. However, as the data
|
by the time running in the \uicontrol Recorded field. However, as the data
|
||||||
@@ -103,79 +112,113 @@
|
|||||||
then select \uicontrol Details next to
|
then select \uicontrol Details next to
|
||||||
\uicontrol {CPU Usage Analyzer Settings}.
|
\uicontrol {CPU Usage Analyzer Settings}.
|
||||||
|
|
||||||
\section2 Selecting Call Graph Mode
|
\image qtcreator-cpu-usage-analyzer-settings.png
|
||||||
|
|
||||||
Select the command to invoke Perf in the \uicontrol {Call graph mode} field.
|
To edit the settings for the current run configuration, you can also select
|
||||||
The \uicontrol {Frame Pointer}, or \c fp, mode relies on frame pointers
|
the dropdown menu next to the \uicontrol {Collect profile data} button.
|
||||||
being available in the profiled application.
|
|
||||||
|
|
||||||
The \uicontrol {Dwarf} mode works also without frame pointers, but
|
\section2 Choosing Event Types
|
||||||
generates significantly more data. Qt and most system libraries are
|
|
||||||
compiled without frame pointers by default, so the frame pointer mode is
|
|
||||||
only useful with customized systems.
|
|
||||||
|
|
||||||
\section2 Setting Stack Snapshot Size
|
In the \uicontrol Events table, you can specify which events should trigger
|
||||||
|
the CPU Usage Analyzer to take a sample. The most common way of analyzing
|
||||||
|
CPU usage involves periodic sampling, driven by hardware performance
|
||||||
|
counters that react to the number of instructions or CPU cycles executed.
|
||||||
|
Alternatively, a software counter that uses the CPU clock can be chosen.
|
||||||
|
|
||||||
In the dwarf mode, Perf takes periodic snapshots of the application stack,
|
Select \uicontrol Add to add events to the table.
|
||||||
which are then analyzed and \e unwound by the CPU Usage Analyzer. Set the
|
In the \uicontrol {Event Type} column, you can choose the general type of
|
||||||
size of the stack snapshots in the \uicontrol {Stack snapshot size} field.
|
event to be sampled, most commonly \uicontrol {hardware} or
|
||||||
Large stack snapshots result in a larger volume of data to be transferred
|
\uicontrol {software}. In the \uicontrol {Counter} column, you can choose
|
||||||
and processed. Small stack snapshots may fail to capture call chains of
|
which specific counter should be used for the sampling. For example,
|
||||||
highly recursive applications or other intense stack usage.
|
\uicontrol {instructions} in the \uicontrol {hardware} group or
|
||||||
|
\uicontrol {cpu-clock} in the \uicontrol {software} group.
|
||||||
|
|
||||||
\section2 Setting Sampling Frequency
|
More specialized sampling, for example by cache misses or cache hits, is
|
||||||
|
possible. However, support for it depends on specific features of the CPU
|
||||||
|
involved. For those specialized events, you can give more detailed sampling
|
||||||
|
instructions in the \uicontrol {Operation} and \uicontrol {Result} columns.
|
||||||
|
For example, you can choose a \uicontrol {cache} event for
|
||||||
|
\uicontrol {L1-dcache} on the \uicontrol {load} operation with a result
|
||||||
|
of \uicontrol {misses}. That would sample L1-dcache misses on reading.
|
||||||
|
|
||||||
Set the sampling frequency for Perf in the \uicontrol {Sampling frequency}
|
Select \uicontrol Remove to remove the selected event from the table.
|
||||||
field. High sampling frequencies result in more accurate data, at the
|
|
||||||
expense of a higher overhead and a larger volume of profiling data being
|
\section2 Choosing a Sampling Mode and Period
|
||||||
generated. The actual sampling frequency is determined by the Linux kernel
|
|
||||||
on the target device, which takes the frequency set for Perf merely as
|
In the \uicontrol {Sample mode} and \uicontrol {Sample period} fields, you
|
||||||
advice. There may be a significant difference between the sampling frequency
|
can specify how samples are triggered:
|
||||||
you request and the actual result.
|
|
||||||
|
\list
|
||||||
|
|
||||||
|
\li Sampling by \uicontrol {event count} instructs the kernel to take
|
||||||
|
a sample every \c n times one of the chosen events has occurred,
|
||||||
|
where \c n is specified in the \uicontrol {Sample period} field.
|
||||||
|
|
||||||
|
\li Sampling by \uicontrol {frequency} instructs the kernel to try and
|
||||||
|
take a sample \c n times per second, by automatically adjusting the
|
||||||
|
sampling period. Specify \c n in the \uicontrol {Sample period}
|
||||||
|
field.
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
High frequencies or low event counts result in more accurate data, at the
|
||||||
|
expense of a higher overhead and a larger volume of data being
|
||||||
|
generated. The actual sampling period is determined by the Linux kernel on
|
||||||
|
the target device, which takes the period set for Perf merely as advice.
|
||||||
|
There may be a significant difference between the sampling period you
|
||||||
|
request and the actual result.
|
||||||
|
|
||||||
In general, if you configure the CPU Usage Analyzer to collect more data
|
In general, if you configure the CPU Usage Analyzer to collect more data
|
||||||
than it can transmit over the connection between the target and the host
|
than it can transmit over the connection between the target and the host
|
||||||
device, the application may get blocked while Perf is trying to send the
|
device, the application may get blocked while Perf is trying to send the
|
||||||
data, and the processing delay may grow excessively. You should then lower
|
data, and the processing delay may grow excessively. You should then change
|
||||||
the \uicontrol {Sampling frequency} or the \uicontrol {Stack snapshot size}.
|
the \uicontrol {Sample period} or the \uicontrol {Stack snapshot size}.
|
||||||
|
|
||||||
|
\section2 Selecting Call Graph Mode
|
||||||
|
|
||||||
|
In the \uicontrol {Call graph mode} field, you can specify how the CPU Usage
|
||||||
|
Analyzer recovers call chains from your application.
|
||||||
|
|
||||||
|
The \uicontrol {Frame Pointer}, or \c fp, mode relies on frame pointers
|
||||||
|
being available in the profiled application and will instruct the kernel on
|
||||||
|
the target device to walk the chain of frame pointers in order to retrieve
|
||||||
|
a call chain for each sample.
|
||||||
|
|
||||||
|
The \uicontrol {Dwarf} mode works also without frame pointers, but
|
||||||
|
generates significantly more data. It takes a snapshot of the current
|
||||||
|
application stack each time a sample is triggered and transmits that
|
||||||
|
snapshot to the host computer for analysis.
|
||||||
|
|
||||||
|
Qt and most system libraries are compiled without frame pointers by
|
||||||
|
default, so the frame pointer mode is only useful with customized systems.
|
||||||
|
|
||||||
|
\section2 Setting Stack Snapshot Size
|
||||||
|
|
||||||
|
The CPU Usage Analyzer will analyze and \e unwind the stack snapshots
|
||||||
|
generated by Perf in dwarf mode. Set the size of the stack snapshots in the
|
||||||
|
\uicontrol {Stack snapshot size} field. Large stack snapshots result in a
|
||||||
|
larger volume of data to be transferred and processed. Small stack
|
||||||
|
snapshots may fail to capture call chains of highly recursive applications
|
||||||
|
or other intense stack usage.
|
||||||
|
|
||||||
\section2 Adding Command Line Options For Perf
|
\section2 Adding Command Line Options For Perf
|
||||||
|
|
||||||
You can specify additional command line options to be passed to Perf when
|
You can specify additional command line options to be passed to Perf when
|
||||||
recording data in the \uicontrol {Additional arguments} field. You may want
|
recording data in the \uicontrol {Additional arguments} field. You may want
|
||||||
to specify \c{--no-delay} or \c{--no-buffering} to reduce the processing delay.
|
to specify \c{--no-delay} or \c{--no-buffering} to reduce the processing
|
||||||
However, those options are not supported by all versions of Perf and Perf may
|
delay. However, those options are not supported by all versions of Perf and
|
||||||
not start if an unsupported option is given.
|
Perf may not start if an unsupported option is given.
|
||||||
|
|
||||||
\section2 Aggregating Data
|
|
||||||
|
|
||||||
In the \uicontrol Granularity field, you can specify whether the data
|
|
||||||
should be aggregated by function or by binary address.
|
|
||||||
|
|
||||||
If you choose \uicontrol Function, all stack frames will be reported with
|
|
||||||
the start address of the function they belong to. Thus, you get a concise
|
|
||||||
overview in the \uicontrol Statistics view, with one entry per function. In
|
|
||||||
the \uicontrol Timeline view, all stack frames from the same function will
|
|
||||||
then have the same color. However, this way you cannot track down which
|
|
||||||
exact lines of code took the most time to execute.
|
|
||||||
|
|
||||||
If you choose \uicontrol Address, the exact address of each stack frame in
|
|
||||||
each sample is reported. Those addresses are then mapped to lines of code,
|
|
||||||
which means that the same function or even line can show up multiple times
|
|
||||||
in the \uicontrol Statistics view. Further, stack frames from the same
|
|
||||||
function will have different colors in the \uicontrol Timeline view,
|
|
||||||
depending on the exact value of the program counter when the sample was
|
|
||||||
recorded.
|
|
||||||
|
|
||||||
\section2 Resolving Names for JIT-compiled JavaScript Functions
|
\section2 Resolving Names for JIT-compiled JavaScript Functions
|
||||||
|
|
||||||
From version 5.6.0, Qt can generate perf.map files with information about
|
Since version 5.6.0, Qt can generate perf.map files with information about
|
||||||
JavaScript functions. The CPU Usage Analyzer will read them and show the
|
JavaScript functions. The CPU Usage Analyzer will read them and show the
|
||||||
function names in the \uicontrol Timeline and \uicontrol Statistics views.
|
function names in the \uicontrol Timeline, \uicontrol Statistics, and
|
||||||
This only works if the process being profiled is running on the host
|
\uicontrol {Flame Graph} views. This only works if the process being
|
||||||
computer, not on the target device. To switch on the generation of perf.map
|
profiled is running on the host computer, not on the target device. To
|
||||||
files, add the environment variable \c QV4_PROFILE_WRITE_PERF_MAP to the
|
switch on the generation of perf.map files, add the environment variable
|
||||||
\uicontrol {Run Environment} and set its value to \c 1.
|
\c QV4_PROFILE_WRITE_PERF_MAP to the \uicontrol {Run Environment} and set
|
||||||
|
its value to \c 1.
|
||||||
|
|
||||||
\section1 Analyzing Collected Data
|
\section1 Analyzing Collected Data
|
||||||
|
|
||||||
@@ -262,14 +305,12 @@
|
|||||||
the interpreter itself, rather than the interpreted JavaScript.
|
the interpreter itself, rather than the interpreted JavaScript.
|
||||||
|
|
||||||
Kernel functions included in call chains are shown on the third row of each
|
Kernel functions included in call chains are shown on the third row of each
|
||||||
thread. All kernel functions are summarized and not differentiated any
|
thread.
|
||||||
further, because most of the time kernel symbols cannot be resolved when the
|
|
||||||
data is analyzed.
|
|
||||||
|
|
||||||
The coloring of the events represents the actual sample rate for the
|
The coloring of the events represents the actual sample rate for the
|
||||||
specific thread they belong to, across their duration. The Linux kernel
|
specific thread they belong to, across their duration. The Linux kernel
|
||||||
will only take a sample of a thread if the thread is active. At the same
|
will only take a sample of a thread if the thread is active. At the same
|
||||||
time, the kernel tries to maintain a constant overall sampling frequency.
|
time, the kernel tries to honor the requested event period.
|
||||||
Thus, differences in the sampling frequency between different threads
|
Thus, differences in the sampling frequency between different threads
|
||||||
indicate that the thread with more samples taken is more likely to be the
|
indicate that the thread with more samples taken is more likely to be the
|
||||||
overall bottleneck, and the thread with less samples taken has likely spent
|
overall bottleneck, and the thread with less samples taken has likely spent
|
||||||
@@ -277,6 +318,8 @@
|
|||||||
|
|
||||||
\section1 Viewing Statistics
|
\section1 Viewing Statistics
|
||||||
|
|
||||||
|
\image qtcreator-cpu-usage-analyzer-statistics.png
|
||||||
|
|
||||||
The \uicontrol Statistics view displays the number of samples each function
|
The \uicontrol Statistics view displays the number of samples each function
|
||||||
in the timeline was contained in, in total and when on the top of the
|
in the timeline was contained in, in total and when on the top of the
|
||||||
stack (called \c self). This allows you to examine which functions you need
|
stack (called \c self). This allows you to examine which functions you need
|
||||||
@@ -296,23 +339,40 @@
|
|||||||
Click on a row to move to the respective function in the source code in the
|
Click on a row to move to the respective function in the source code in the
|
||||||
code editor and select it in the main view.
|
code editor and select it in the main view.
|
||||||
|
|
||||||
When you select a stack frame in the \uicontrol Timeline view, information
|
|
||||||
about it is displayed in the \uicontrol Statistics view. To view a time
|
|
||||||
range in the \uicontrol Statistics view, select
|
|
||||||
\uicontrol {Limit Statistics to Selected Range} in the context menu in the
|
|
||||||
\uicontrol Timeline view.
|
|
||||||
|
|
||||||
To copy the contents of one view or row to the clipboard, select
|
To copy the contents of one view or row to the clipboard, select
|
||||||
\uicontrol {Copy Table} or \uicontrol {Copy Row} in the context menu.
|
\uicontrol {Copy Table} or \uicontrol {Copy Row} in the context menu.
|
||||||
|
|
||||||
|
\section2 Visualizing Statistics as Flame Graphs
|
||||||
|
|
||||||
|
\image qtcreator-cpu-usage-analyzer-flamegraph.png
|
||||||
|
|
||||||
|
The \uicontrol {Flame Graph} view shows a more concise statistical overview
|
||||||
|
of the execution. The horizontal bars show the total number of samples
|
||||||
|
taken for a certain function, relative to the total number of samples. The
|
||||||
|
nesting shows which functions were called by which other ones.
|
||||||
|
|
||||||
|
\section2 Interaction between the views
|
||||||
|
|
||||||
|
When you select a stack frame in either of the \uicontrol {Timeline},
|
||||||
|
\uicontrol {Flame Graph}, or \uicontrol {Statistics} views, information
|
||||||
|
about it is displayed in the other two views. To view a time range in the
|
||||||
|
\uicontrol {Statistics} and \uicontrol {Flame Graph} views, select
|
||||||
|
\uicontrol {Limit Statistics to Selected Range} in the context menu in the
|
||||||
|
\uicontrol {Timeline} view.
|
||||||
|
|
||||||
\section1 Loading Perf Data Files
|
\section1 Loading Perf Data Files
|
||||||
|
|
||||||
You can load any \c perf.data files generated by recent versions of the
|
You can load any \c perf.data files generated by recent versions of the
|
||||||
Linux Perf tool and view them in \QC. Select \uicontrol Analyze >
|
Linux Perf tool and view them in \QC. Select \uicontrol Analyze >
|
||||||
\uicontrol {Load Trace} to load a file. The CPU Usage Analyzer needs to know
|
\uicontrol {CPU Usage Analyzer Options} > \uicontrol {Load perf.data} to
|
||||||
the context in which the data was recorded to find the debug symbols.
|
load a file.
|
||||||
Therefore, you have to specify the kit that the application was built with
|
|
||||||
and the folder where the application executable is located.
|
\image qtcreator-cpu-usage-analyzer-load-perf-trace.png
|
||||||
|
|
||||||
|
The CPU Usage Analyzer needs to know the context in which the
|
||||||
|
data was recorded to find the debug symbols. Therefore, you have to specify
|
||||||
|
the kit that the application was built with and the folder where the
|
||||||
|
application executable is located.
|
||||||
|
|
||||||
The Perf data files are generated by calling \c {perf record}. Make sure to
|
The Perf data files are generated by calling \c {perf record}. Make sure to
|
||||||
generate call graphs when recording data by starting Perf with the
|
generate call graphs when recording data by starting Perf with the
|
||||||
@@ -331,34 +391,42 @@
|
|||||||
back its own data in a sensible way by checking the output of
|
back its own data in a sensible way by checking the output of
|
||||||
\c {perf report} or \c {perf script} for the recorded Perf data files.
|
\c {perf report} or \c {perf script} for the recorded Perf data files.
|
||||||
|
|
||||||
|
\section1 Loading and Saving Trace Files
|
||||||
|
|
||||||
|
You can save and load trace data in a format specific to the
|
||||||
|
CPU Usage Analyzer with the respective entries in \uicontrol Analyze >
|
||||||
|
\uicontrol {CPU Usage Analyzer Options}. This format is self-contained, and
|
||||||
|
therefore loading it does not require you to specify the recording
|
||||||
|
environment. You can transfer such trace files to a different computer
|
||||||
|
without any tool chain or debug symbols and analyze them there.
|
||||||
|
|
||||||
\section1 Troubleshooting
|
\section1 Troubleshooting
|
||||||
|
|
||||||
The CPU Usage Analyzer might fail to record data for the following reasons:
|
The CPU Usage Analyzer might fail to record data for the following reasons:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li The connection between the target device and the host may not be
|
\li The connection between the target device and the host may not be
|
||||||
fast enough to transfer the data produced by Perf. Try lowering
|
fast enough to transfer the data produced by Perf. Try modifying
|
||||||
the \uicontrol {Stack snapshot size} or
|
the values of the \uicontrol {Stack snapshot size} or
|
||||||
\uicontrol {Sampling Frequency} settings.
|
\uicontrol {Sample period} settings.
|
||||||
\li Perf may be buffering the data forever, never sending it. Add
|
\li Perf may be buffering the data forever, never sending it. Add
|
||||||
\c {--no-delay} or \c {--no-buffering} to the
|
\c {--no-delay} or \c {--no-buffering} to the
|
||||||
\uicontrol {Additional arguments} field.
|
\uicontrol {Additional arguments} field.
|
||||||
\li Some versions of Perf will not start recording unless given a
|
\li Some versions of Perf will not start recording unless given a
|
||||||
certain minimum sampling frequency. Try with a
|
certain minimum sampling frequency. Try with a
|
||||||
\uicontrol {Sampling Frequency} of 1000.
|
\uicontrol {Sample period} value of 1000.
|
||||||
\li On some devices, in particular various i.MX6 Boards, the hardware
|
\li On some devices, in particular various i.MX6 Boards, the hardware
|
||||||
performance counters are dysfunctional and the Linux kernel may
|
performance counters are dysfunctional and the Linux kernel may
|
||||||
randomly fail to record data after some time. Perf can use different
|
randomly fail to record data after some time. Perf can use different
|
||||||
types of events to trigger samples. You can get a list of available
|
types of events to trigger samples. You can get a list of available
|
||||||
event types by running \c {perf list} on the device and add
|
event types by running \c {perf list} on the device and then choose
|
||||||
\c {-e <event type>} to the \uicontrol {Additional arguments} field
|
the respective event types in the settings. The choice of event type
|
||||||
to change the event type to be used. The choice of event type
|
affects the performance and stability of the sampling. The
|
||||||
affects the performance and stability of the sampling.
|
\c {cpu-clock} \c {software} event is a safe but relatively slow
|
||||||
\c {-e cpu-clock} is a safe but relatively slow option as it
|
option as it does not use the hardware performance counters, but
|
||||||
does not use the hardware performance counters, but drives the
|
drives the sampling from software. After the sampling has failed,
|
||||||
sampling from software. After the sampling has failed, reboot the
|
reboot the device. The kernel may have disabled important parts of
|
||||||
device. The kernel may have disabled important parts of the
|
the performance counters system.
|
||||||
performance counters system.
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
Output from the helper program that processes the data is displayed in the
|
Output from the helper program that processes the data is displayed in the
|
||||||
|
@@ -211,7 +211,7 @@
|
|||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||||
\uicontrol {Other Project} > \uicontrol {Qt Quick UI} >
|
\uicontrol {Other Project} > \uicontrol {Qt Quick UI Prototype} >
|
||||||
\uicontrol Choose.
|
\uicontrol Choose.
|
||||||
|
|
||||||
\li In the \uicontrol {Minimal required Qt version} field, select the Qt
|
\li In the \uicontrol {Minimal required Qt version} field, select the Qt
|
||||||
@@ -222,8 +222,9 @@
|
|||||||
Qt Quick Controls, Qt Quick Dialogs, and Qt Quick Layouts (available
|
Qt Quick Controls, Qt Quick Dialogs, and Qt Quick Layouts (available
|
||||||
since Qt 5.1).
|
since Qt 5.1).
|
||||||
|
|
||||||
\li Select the \uicontrol {With .ui.qml file} check box to create an UI
|
\li Select the \uicontrol {Use Qt Virtual Keyboard} check box to add
|
||||||
form.
|
support for \l{http://doc.qt.io/qt-5/qtvirtualkeyboard-index.html}
|
||||||
|
{Qt Virtual Keyboard} to the application.
|
||||||
|
|
||||||
\li Select \uicontrol Next (or \uicontrol Continue on \macos).
|
\li Select \uicontrol Next (or \uicontrol Continue on \macos).
|
||||||
|
|
||||||
|
@@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
#include "navigationtreeview.h"
|
#include "navigationtreeview.h"
|
||||||
|
|
||||||
#include <QHeaderView>
|
|
||||||
#include <QFocusEvent>
|
#include <QFocusEvent>
|
||||||
|
#include <QHeaderView>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -62,13 +62,18 @@ void NavigationTreeView::scrollTo(const QModelIndex &index, QAbstractItemView::S
|
|||||||
// work around QTBUG-3927
|
// work around QTBUG-3927
|
||||||
QScrollBar *hBar = horizontalScrollBar();
|
QScrollBar *hBar = horizontalScrollBar();
|
||||||
int scrollX = hBar->value();
|
int scrollX = hBar->value();
|
||||||
|
|
||||||
const int viewportWidth = viewport()->width();
|
const int viewportWidth = viewport()->width();
|
||||||
const QRect itemRect = visualRect(index);
|
QRect itemRect = visualRect(index);
|
||||||
|
|
||||||
|
QAbstractItemDelegate *delegate = itemDelegate(index);
|
||||||
|
if (delegate)
|
||||||
|
itemRect.setWidth(delegate->sizeHint(viewOptions(), index).width());
|
||||||
|
|
||||||
if (itemRect.x() - indentation() < 0) {
|
if (itemRect.x() - indentation() < 0) {
|
||||||
// scroll so left edge minus one indent of item is visible
|
// scroll so left edge minus one indent of item is visible
|
||||||
scrollX += itemRect.x() - indentation();
|
scrollX += itemRect.x() - indentation();
|
||||||
} else if (itemRect.right() > viewportWidth
|
} else if (itemRect.right() > viewportWidth) {
|
||||||
&& (viewportWidth - itemRect.x() < 3 * viewportWidth / 4)) {
|
|
||||||
// If right edge of item is not visible and left edge is "too far right",
|
// If right edge of item is not visible and left edge is "too far right",
|
||||||
// then move so it is either fully visible, or to the left edge.
|
// then move so it is either fully visible, or to the left edge.
|
||||||
// For this move the left edge one indent to the left, so the parent can potentially
|
// For this move the left edge one indent to the left, so the parent can potentially
|
||||||
|
@@ -40,6 +40,7 @@ CMakeInputsNode::CMakeInputsNode(const Utils::FileName &cmakeLists) :
|
|||||||
setPriority(Node::DefaultPriority - 10); // Bottom most!
|
setPriority(Node::DefaultPriority - 10); // Bottom most!
|
||||||
setDisplayName(QCoreApplication::translate("CMakeFilesProjectNode", "CMake Modules"));
|
setDisplayName(QCoreApplication::translate("CMakeFilesProjectNode", "CMake Modules"));
|
||||||
setIcon(QIcon(":/projectexplorer/images/session.png")); // TODO: Use a better icon!
|
setIcon(QIcon(":/projectexplorer/images/session.png")); // TODO: Use a better icon!
|
||||||
|
setListInProject(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray CMakeInputsNode::generateId(const Utils::FileName &inputFile)
|
QByteArray CMakeInputsNode::generateId(const Utils::FileName &inputFile)
|
||||||
@@ -57,6 +58,7 @@ CMakeListsNode::CMakeListsNode(const Utils::FileName &cmakeListPath) :
|
|||||||
{
|
{
|
||||||
static QIcon folderIcon = Core::FileIconProvider::directoryIcon(Constants::FILEOVERLAY_CMAKE);
|
static QIcon folderIcon = Core::FileIconProvider::directoryIcon(Constants::FILEOVERLAY_CMAKE);
|
||||||
setIcon(folderIcon);
|
setIcon(folderIcon);
|
||||||
|
setListInProject(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMakeListsNode::showInSimpleTree() const
|
bool CMakeListsNode::showInSimpleTree() const
|
||||||
@@ -69,6 +71,7 @@ CMakeProjectNode::CMakeProjectNode(const Utils::FileName &directory) :
|
|||||||
{
|
{
|
||||||
setPriority(Node::DefaultProjectPriority + 1000);
|
setPriority(Node::DefaultProjectPriority + 1000);
|
||||||
setIcon(QIcon(":/projectexplorer/images/projectexplorer.png")); // TODO: Use proper icon!
|
setIcon(QIcon(":/projectexplorer/images/projectexplorer.png")); // TODO: Use proper icon!
|
||||||
|
setListInProject(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMakeProjectNode::showInSimpleTree() const
|
bool CMakeProjectNode::showInSimpleTree() const
|
||||||
@@ -86,6 +89,7 @@ CMakeTargetNode::CMakeTargetNode(const Utils::FileName &directory, const QString
|
|||||||
{
|
{
|
||||||
setPriority(Node::DefaultProjectPriority + 900);
|
setPriority(Node::DefaultProjectPriority + 900);
|
||||||
setIcon(QIcon(":/projectexplorer/images/build.png")); // TODO: Use proper icon!
|
setIcon(QIcon(":/projectexplorer/images/build.png")); // TODO: Use proper icon!
|
||||||
|
setListInProject(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray CMakeTargetNode::generateId(const Utils::FileName &directory, const QString &target)
|
QByteArray CMakeTargetNode::generateId(const Utils::FileName &directory, const QString &target)
|
||||||
|
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <utils/detailswidget.h>
|
#include <utils/detailswidget.h>
|
||||||
#include <utils/fancylineedit.h>
|
#include <utils/fancylineedit.h>
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/pathchooser.h>
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
@@ -64,7 +65,17 @@ const char TITLE_KEY[] = "CMakeProjectManager.CMakeRunConfiguation.Title";
|
|||||||
CMakeRunConfiguration::CMakeRunConfiguration(Target *target)
|
CMakeRunConfiguration::CMakeRunConfiguration(Target *target)
|
||||||
: RunConfiguration(target)
|
: RunConfiguration(target)
|
||||||
{
|
{
|
||||||
addExtraAspect(new LocalEnvironmentAspect(this, LocalEnvironmentAspect::BaseEnvironmentModifier()));
|
// Workaround for QTCREATORBUG-19354:
|
||||||
|
auto cmakeRunEnvironmentModifier = [](RunConfiguration *rc, Utils::Environment &env) {
|
||||||
|
if (!Utils::HostOsInfo::isWindowsHost() || !rc)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const Kit *k = rc->target()->kit();
|
||||||
|
const QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(k);
|
||||||
|
if (qt)
|
||||||
|
env.prependOrSetPath(qt->qmakeProperty("QT_INSTALL_BINS"));
|
||||||
|
};
|
||||||
|
addExtraAspect(new LocalEnvironmentAspect(this, cmakeRunEnvironmentModifier));
|
||||||
addExtraAspect(new ArgumentsAspect(this, "CMakeProjectManager.CMakeRunConfiguration.Arguments"));
|
addExtraAspect(new ArgumentsAspect(this, "CMakeProjectManager.CMakeRunConfiguration.Arguments"));
|
||||||
addExtraAspect(new TerminalAspect(this, "CMakeProjectManager.CMakeRunConfiguration.UseTerminal"));
|
addExtraAspect(new TerminalAspect(this, "CMakeProjectManager.CMakeRunConfiguration.UseTerminal"));
|
||||||
addExtraAspect(new WorkingDirectoryAspect(this, "CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"));
|
addExtraAspect(new WorkingDirectoryAspect(this, "CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"));
|
||||||
|
@@ -525,8 +525,6 @@ ProjectExplorer::Macros CppModelManager::internalDefinedMacros() const
|
|||||||
for (const ProjectPart::Ptr &part : pinfo.projectParts()) {
|
for (const ProjectPart::Ptr &part : pinfo.projectParts()) {
|
||||||
addUnique(part->toolChainMacros, macros, alreadyIn);
|
addUnique(part->toolChainMacros, macros, alreadyIn);
|
||||||
addUnique(part->projectMacros, macros, alreadyIn);
|
addUnique(part->projectMacros, macros, alreadyIn);
|
||||||
if (!part->projectConfigFile.isEmpty())
|
|
||||||
macros += ProjectExplorer::Macro::toMacros(ProjectPart::readProjectConfigFile(part));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return macros;
|
return macros;
|
||||||
|
@@ -190,6 +190,8 @@ static ProjectPart::Ptr projectPartFromRawProjectPart(const RawProjectPart &rawP
|
|||||||
part->buildTargetType = rawProjectPart.buildTargetType;
|
part->buildTargetType = rawProjectPart.buildTargetType;
|
||||||
part->qtVersion = rawProjectPart.qtVersion;
|
part->qtVersion = rawProjectPart.qtVersion;
|
||||||
part->projectMacros = rawProjectPart.projectMacros;
|
part->projectMacros = rawProjectPart.projectMacros;
|
||||||
|
if (!part->projectConfigFile.isEmpty())
|
||||||
|
part->projectMacros += ProjectExplorer::Macro::toMacros(ProjectPart::readProjectConfigFile(part));
|
||||||
part->headerPaths = rawProjectPart.headerPaths;
|
part->headerPaths = rawProjectPart.headerPaths;
|
||||||
part->precompiledHeaders = rawProjectPart.precompiledHeaders;
|
part->precompiledHeaders = rawProjectPart.precompiledHeaders;
|
||||||
part->selectedForBuilding = rawProjectPart.selectedForBuilding;
|
part->selectedForBuilding = rawProjectPart.selectedForBuilding;
|
||||||
|
@@ -35,9 +35,10 @@ namespace CppTools {
|
|||||||
|
|
||||||
void ProjectPart::updateLanguageFeatures()
|
void ProjectPart::updateLanguageFeatures()
|
||||||
{
|
{
|
||||||
const bool hasQt = qtVersion != NoQt;
|
const bool hasCxx = languageVersion >= CXX98;
|
||||||
|
const bool hasQt = hasCxx && qtVersion != NoQt;
|
||||||
languageFeatures.cxx11Enabled = languageVersion >= CXX11;
|
languageFeatures.cxx11Enabled = languageVersion >= CXX11;
|
||||||
languageFeatures.cxxEnabled = languageVersion >= CXX98;
|
languageFeatures.cxxEnabled = hasCxx;
|
||||||
languageFeatures.c99Enabled = languageVersion >= C99;
|
languageFeatures.c99Enabled = languageVersion >= C99;
|
||||||
languageFeatures.objCEnabled = languageExtensions.testFlag(ObjectiveCExtensions);
|
languageFeatures.objCEnabled = languageExtensions.testFlag(ObjectiveCExtensions);
|
||||||
languageFeatures.qtEnabled = hasQt;
|
languageFeatures.qtEnabled = hasQt;
|
||||||
|
@@ -143,7 +143,6 @@ QbsRunConfiguration::QbsRunConfiguration(Target *target)
|
|||||||
void QbsRunConfiguration::initialize(Core::Id id)
|
void QbsRunConfiguration::initialize(Core::Id id)
|
||||||
{
|
{
|
||||||
RunConfiguration::initialize(id);
|
RunConfiguration::initialize(id);
|
||||||
m_uniqueProductName = uniqueProductNameFromId(id);
|
|
||||||
|
|
||||||
setDefaultDisplayName(defaultDisplayName());
|
setDefaultDisplayName(defaultDisplayName());
|
||||||
installStepChanged();
|
installStepChanged();
|
||||||
@@ -215,7 +214,7 @@ Runnable QbsRunConfiguration::runnable() const
|
|||||||
QString QbsRunConfiguration::executable() const
|
QString QbsRunConfiguration::executable() const
|
||||||
{
|
{
|
||||||
QbsProject *pro = static_cast<QbsProject *>(target()->project());
|
QbsProject *pro = static_cast<QbsProject *>(target()->project());
|
||||||
const qbs::ProductData product = findProduct(pro->qbsProjectData(), m_uniqueProductName);
|
const qbs::ProductData product = findProduct(pro->qbsProjectData(), uniqueProductName());
|
||||||
|
|
||||||
if (!product.isValid() || !pro->qbsProject().isValid())
|
if (!product.isValid() || !pro->qbsProject().isValid())
|
||||||
return QString();
|
return QString();
|
||||||
@@ -226,7 +225,7 @@ QString QbsRunConfiguration::executable() const
|
|||||||
bool QbsRunConfiguration::isConsoleApplication() const
|
bool QbsRunConfiguration::isConsoleApplication() const
|
||||||
{
|
{
|
||||||
QbsProject *pro = static_cast<QbsProject *>(target()->project());
|
QbsProject *pro = static_cast<QbsProject *>(target()->project());
|
||||||
const qbs::ProductData product = findProduct(pro->qbsProjectData(), m_uniqueProductName);
|
const qbs::ProductData product = findProduct(pro->qbsProjectData(), uniqueProductName());
|
||||||
return product.properties().value(QLatin1String("consoleApplication"), false).toBool();
|
return product.properties().value(QLatin1String("consoleApplication"), false).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +241,7 @@ void QbsRunConfiguration::addToBaseEnvironment(Utils::Environment &env) const
|
|||||||
{
|
{
|
||||||
QbsProject *project = static_cast<QbsProject *>(target()->project());
|
QbsProject *project = static_cast<QbsProject *>(target()->project());
|
||||||
if (project && project->qbsProject().isValid()) {
|
if (project && project->qbsProject().isValid()) {
|
||||||
const qbs::ProductData product = findProduct(project->qbsProjectData(), m_uniqueProductName);
|
const qbs::ProductData product = findProduct(project->qbsProjectData(), uniqueProductName());
|
||||||
if (product.isValid()) {
|
if (product.isValid()) {
|
||||||
QProcessEnvironment procEnv = env.toProcessEnvironment();
|
QProcessEnvironment procEnv = env.toProcessEnvironment();
|
||||||
procEnv.insert(QLatin1String("QBS_RUN_FILE_PATH"), executable());
|
procEnv.insert(QLatin1String("QBS_RUN_FILE_PATH"), executable());
|
||||||
@@ -274,7 +273,7 @@ QString QbsRunConfiguration::buildSystemTarget() const
|
|||||||
|
|
||||||
QString QbsRunConfiguration::uniqueProductName() const
|
QString QbsRunConfiguration::uniqueProductName() const
|
||||||
{
|
{
|
||||||
return m_uniqueProductName;
|
return uniqueProductNameFromId(id());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QbsRunConfiguration::defaultDisplayName()
|
QString QbsRunConfiguration::defaultDisplayName()
|
||||||
|
@@ -79,8 +79,6 @@ private:
|
|||||||
|
|
||||||
void updateTarget();
|
void updateTarget();
|
||||||
|
|
||||||
QString m_uniqueProductName;
|
|
||||||
|
|
||||||
QbsInstallStep *m_currentInstallStep = nullptr; // We do not take ownership!
|
QbsInstallStep *m_currentInstallStep = nullptr; // We do not take ownership!
|
||||||
ProjectExplorer::BuildStepList *m_currentBuildStepList = nullptr; // We do not take ownership!
|
ProjectExplorer::BuildStepList *m_currentBuildStepList = nullptr; // We do not take ownership!
|
||||||
};
|
};
|
||||||
|
@@ -35,6 +35,7 @@ const char rootCategory[] = "";
|
|||||||
|
|
||||||
const char selectionCategory[] = "Selection";
|
const char selectionCategory[] = "Selection";
|
||||||
const char stackCategory[] = "Stack (z)";
|
const char stackCategory[] = "Stack (z)";
|
||||||
|
const char qmlPreviewCategory[] = "QmlPreview";
|
||||||
const char editCategory[] = "Edit";
|
const char editCategory[] = "Edit";
|
||||||
const char anchorsCategory[] = "Anchors";
|
const char anchorsCategory[] = "Anchors";
|
||||||
const char positionCategory[] = "Position";
|
const char positionCategory[] = "Position";
|
||||||
@@ -147,8 +148,9 @@ const char increaseIndexOfStackedContainerToolTip[] = QT_TRANSLATE_NOOP("QmlDesi
|
|||||||
const char decreaseIndexOfStackedContainerToolTip[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Decrease index of stacked container.");
|
const char decreaseIndexOfStackedContainerToolTip[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Decrease index of stacked container.");
|
||||||
const char addItemToStackedContainerToolTip[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Add item to stacked container.");
|
const char addItemToStackedContainerToolTip[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Add item to stacked container.");
|
||||||
|
|
||||||
const int priorityFirst = 220;
|
const int priorityFirst = 240;
|
||||||
const int prioritySelectionCategory = 200;
|
const int prioritySelectionCategory = 220;
|
||||||
|
const int priorityQmlPreviewCategory = 200;
|
||||||
const int priorityStackCategory = 180;
|
const int priorityStackCategory = 180;
|
||||||
const int priorityEditCategory = 160;
|
const int priorityEditCategory = 160;
|
||||||
const int priorityAnchorsCategory = 140;
|
const int priorityAnchorsCategory = 140;
|
||||||
|
@@ -54,6 +54,8 @@ public:
|
|||||||
void setValue(const QVariant &value, qreal frame);
|
void setValue(const QVariant &value, qreal frame);
|
||||||
QVariant value(qreal frame) const;
|
QVariant value(qreal frame) const;
|
||||||
|
|
||||||
|
TypeName valueType() const;
|
||||||
|
|
||||||
qreal currentFrame() const;
|
qreal currentFrame() const;
|
||||||
|
|
||||||
bool hasKeyframe(qreal frame);
|
bool hasKeyframe(qreal frame);
|
||||||
|
@@ -118,6 +118,16 @@ QVariant QmlTimelineFrames::value(qreal frame) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TypeName QmlTimelineFrames::valueType() const
|
||||||
|
{
|
||||||
|
const ModelNode targetNode = target();
|
||||||
|
|
||||||
|
if (targetNode.isValid() && targetNode.hasMetaInfo())
|
||||||
|
return targetNode.metaInfo().propertyTypeName(propertyName());
|
||||||
|
|
||||||
|
return TypeName();
|
||||||
|
}
|
||||||
|
|
||||||
bool QmlTimelineFrames::hasKeyframe(qreal frame)
|
bool QmlTimelineFrames::hasKeyframe(qreal frame)
|
||||||
{
|
{
|
||||||
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
||||||
|
Reference in New Issue
Block a user