Age | Commit message (Collapse) | Author | Files | Lines |
|
Make the message easier to read and understand by separating the
QProcess's error and the Standard error.
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
|
|
Removing duplicate code.
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
|
|
The error message is printed using the method KsMainWindow::_error().
The message itself remains unchanged. If we want to change the message,
this can be done in another patch.
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
|
|
If KernelShark GUI has been started as Root we do not need to use
"pkexec" when starting the Record dialog. Note that the actual place
where "pkexec" gets used is in the script "kshark-su-record".
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
|
|
Running the KernelShark GUI with Root privileges is not recommended due
to security reasons. The user will be allowed to continue on its own risk.
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204475
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
|
|
A previous commit removed the unnecessary calls of loadColors() in
KsGLWidget::paintGL(), however this has the side effect of making
the Color scheme slider nonfunctional. We have to explicitly reload
the color tables of the GL widget every time when the slider is moved.
The bug was reported by Jake Edge in his article about KernelShark on
LWN.net. Thanks Jake!
Reported-by: Jake Edge <jake@edge2.net>
Fixing: 3a50d107e9 ("kernel-shark: Avoid the unnecessary calls of KsGLWidget::loadColors()")
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
|
|
Fix buffer overflow observed when running perf test.
The overflow is when trying to evaluate "1ULL << (64 - 1)" which is
resulting in -9223372036854775808 which overflows the 20 character
buffer.
If is possible this bug has been reported before but I still don't see
any fix checked in:
See: https://www.spinics.net/lists/linux-perf-users/msg07714.html
Link: http://lore.kernel.org/linux-trace-devel/20190807121446.1833-1-tz.stoyanov@gmail.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204517
Reported-by: Michael Sartain <mikesart@fastmail.com>
Reported-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Tony Jones <tonyj@suse.de>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Fixes: f7d82350e597 ("tools/events: Add files to create libtraceevent.a")
Link: http://lkml.kernel.org/r/20190228015532.8941-1-tonyj@suse.de
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The "kernel_stack" event handler does not depend on any trace-cmd
context, it can be used aside from the application. The code is
moved to libtraceevent "function" plugin.
Link: http://lore.kernel.org/linux-trace-devel/20190726124308.18735-2-tz.stoyanov@gmail.com
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The .svg files of the new logo and icon for KernelShark are corrupted.
Looks like this happened because the original patch that added the files
was trimmed because of the SMTP maximum line length limit.
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
|
|
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
KernelShark 1.0 has a new logo. Update the documentation to use it.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This reverts the change in a45ab5a44 ("kernel-shark: Remove hard-coded
install paths") that removed the full path of installing
org.freedesktop.kshark-record.policy to a relative path. This means if we
installed in /usr/local/bin the policy still needs to go into
/usr/share/polkit-1/actions/
This does not affect DESTDIR, as installing still goes in the relative path
from DESTDIR for package maintainers.
Link: http://lore.kernel.org/linux-trace-devel/20190725194739.140392211@goodmis.org
Suggested-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This reverts:
8eb0d753e ("kernel-shark: Execute kshark-record from same dir as kshark-su-record")
b084eb5aa ("kernel-shark: Set the DISPLAY environment for pkexec kshark-record")
As the policykit (when installed correctly), should handle both the path to
the executable, as well as the DISPLAY and XAUTHORITY environment variables.
Link: http://lore.kernel.org/linux-trace-devel/20190725194738.979632340@goodmis.org
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Some vendors use different names for Python in pkgconfig, this allows
the name of the Python version in pkgconfig to differ from the Python
interperter name. The default remains the Python version.
Link: http://lore.kernel.org/linux-trace-devel/20190725204237.3864194-1-chutzpah@gentoo.org
Signed-off-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The previous soname patch was an earlier version that included the full
path to the build output as the soname (not sure how that happened).
This just uses the basename as the soname, so ld will be able to
properly find the library.
Link: http://lore.kernel.org/linux-trace-devel/20190725014808.3646716-1-chutzpah@gentoo.org
Signed-off-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Python 3 does not have PyInt anymore, so use the PyLong_* functions when
building on Python 3.
Link: http://lore.kernel.org/linux-trace-devel/20190725174138.3724131-4-chutzpah@gentoo.org
Signed-off-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The templates that generate Python bindings are missing some headers
that result in compile-time warnings. This adds the missing headers
where needed.
Link: http://lore.kernel.org/linux-trace-devel/20190725174138.3724131-3-chutzpah@gentoo.org
Signed-off-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
As PyString_FromString() is no longer available with Python 3, use
PyUnicode_FromString() which is available in both Python 2 and 3.
Link: http://lkml.kernel.org/r/20190725174138.3724131-2-chutzpah@gentoo.org
Reported-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
There is a typo in few trace-cmd warning messages:
"cound not" -> "could not"
Link: http://lore.kernel.org/linux-trace-devel/20190725105731.28782-1-tz.stoyanov@gmail.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In order to make connections to the X server, users must be in
the X server allow list. As kernelshark may run with root privileges,
the user "root" must be in this list. There is such logic in
kshark-su-record, but it works only for Wayland X server. Some Linux
distributions use other X servers, so the logic must be executed always.
It grants access to user "root" to initiate connections to the X server from
the local machine.
Link: http://lore.kernel.org/linux-trace-devel/20190725085355.15921-1-tz.stoyanov@gmail.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204277
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
As we need to update both LDFLAGS and CFLAGS, move the test to see if
udisc86 is installed to a variable, and then set NO_UDIS86 if it is not
found. This way we do not need to test if it exists twice, nor have
LDFLAGS set unconditionally.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204277
Link: http://lore.kernel.org/linux-trace-devel/20190724190758.4e18498f@gandalf.local.home
Reported-by: howaboutsynergy@pm.me
Tested-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Error message will be printed to the console-like widget.
Link: http://lore.kernel.org/linux-trace-devel/20190724154039.23705-5-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
A configuration file (Json) for the Capture dialog can contain
non-existing tracer plugin or events. This can happen if the
configuration was exported on one machine and then imported on
another. In such a case the non-existing plugin/events will be
ignored and a warning message will be printed to the console-like
widget.
Link: http://lore.kernel.org/linux-trace-devel/20190724154039.23705-4-y.karadz@gmail.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204287
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This will be used to show Warning messages.
Link: http://lore.kernel.org/linux-trace-devel/20190724154039.23705-3-y.karadz@gmail.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204287
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Instead of aborting, the function will ignore (skip) the non-existing
event and will continue loading the other events in the configuration
file. The return type is changed to int in order to provide information
about the number of events successfully added to the filter.
Link: http://lore.kernel.org/linux-trace-devel/20190724154039.23705-2-y.karadz@gmail.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204287
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In the case of an error the "Capture" button of the Record dialog is
disabled.
Link: http://lore.kernel.org/linux-trace-devel/20190724154110.23772-1-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When running a fresh install, I hit this:
ERROR: Capture process failed:
Unknown errorqt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.
This was due to pkexec not saving the DISPLAY environment variable. To solve
this, pass that variable as one of the environment variables to pkexec.
Link: http://lore.kernel.org/linux-trace-devel/20190723225238.859019956@goodmis.org
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Do not trust the PATH environment variable (and in fact that may not even be
available with the pkexec). Instead, use the same path as kshark-su-record
to find kshark-record. They should always be together anyway.
Link: http://lore.kernel.org/linux-trace-devel/20190723225238.701263380@goodmis.org
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
If the tracefs directory is configured into the kernel, and
kshark-record fails to find the tracing directory, it should test if
it already has root privileges (geteuid() returns zero), before posting
a message "Root privileges are required" as that can confuse users.
Link: http://lore.kernel.org/linux-trace-devel/20190723165935.300f58e8@gandalf.local.home
Reported-by: howaboutsynergy@pm.me
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The error message includes the case when the tracing directory cannot be
found or mounted.
Link: http://lore.kernel.org/linux-trace-devel/20190723125204.22799-3-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The function has to be able to handle safely the case when the Checkbox
tree widget is empty or it does not contain the item to be removed.
Link: http://lore.kernel.org/linux-trace-devel/20190723125204.22799-2-y.karadz@gmail.com
Reported-by: howaboutsynergy <howaboutsynergy@pm.me>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204277
Fixes: 4a02481fff (Remove all system=ftrace events from Record dialog)
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The absolute path to the trace-cmd executable gets derived from
"_INSTALL_PREFIX", and the "Record" dialog will be using its installed
version. This is done because nothing guaranties that the trace-cmd
executable will be presented at the time when the KernelShark package
is built. The rule has one exception and this is the case when the build
type is "Debug". In "Debug" mode the "Record" dialog will try to use the
version of the trace-cmd executable from the build location.
Link: http://lore.kernel.org/linux-trace-devel/20190723182542.1295-1-y.karadz@gmail.com
Sugested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Currently trace-cmd installs some shared libraries, but does not set a
SONAME on these. This often violates distro policies, so it should at
least set something.
This patch sets it to the name of the file, which is somewhat naieve,
but works for many libraries. Generally it should be set to have an ABI
version as the extension, so when the developer breaks ABI, they can
change the soname.
Link: http://lore.kernel.org/linux-trace-devel/20190720030344.1991393-5-chutzpah@gentoo.org
Signed-off-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The trace-cmd build system installs headers for building kernelshark,
but it is missing trace-seq.h and trace-filter-hash.h.
It additionally installs event-parse.h to the toplevel "trace-cmd"
include directory, but the generated header includes it as
"traceevent/event-parse.h" so the kernelshark build fails.
This patch installs all the headers needed to build kernelshark to the
appropiate directories.
Link: http://lore.kernel.org/linux-trace-devel/20190720030344.1991393-4-chutzpah@gentoo.org
Signed-off-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Currently if udis86 is detected on the system, trace-cmd automatically
uses it. This is generally a problem for packagers since if the build
machine happens to have udis86, now there is a dependency on it that may
or may not be tracked.
This adds a NO_UDIS86 variable that can be set by the packager to
disable using udis86 completely.
Link: http://lore.kernel.org/linux-trace-devel/20190723151112.59ef336c@gandalf.local.home
Signed-off-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The current Makefile hardcodes the python module install directory, so
packages can't put them in their distro's perferred location. This
allows the directory to be overriden on the command line.
Link: http://lore.kernel.org/linux-trace-devel/20190720030344.1991393-2-chutzpah@gentoo.org
Signed-off-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Python 3 has deprecated PyInt_AS_LONG. Add code to use PyLong_AsLong() if
Python 3 is detected. As Python 2 is going to be EOL soon, we need to
support Python 3.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204231
Link: http://lore.kernel.org/linux-trace-devel/20190719225030.507227790@goodmis.org
Reported-by: Troy Engel <troyengel@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Python 3 has deprecated PyBuffer_FromMemory() and instead has
PyMemoryView_FromMemory(). Add a helper function that uses the latter if
Python 3 is detected. As Python 2 is going to be EOL soon, we need to
support Python 3.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204231
Link: http://lore.kernel.org/linux-trace-devel/20190719225030.345100829@goodmis.org
Reported-by: Troy Engel <troyengel@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Python 3 has deprecated PyString_FromString(), but both Python 2 and
Python 3 have PyUnicode_FromString() which should be equivalent (at least
according to google). As Python 2 is going to be EOL soon, we need to
support Python 3.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204231
Link: http://lore.kernel.org/linux-trace-devel/20190719225030.187908166@goodmis.org
Reported-by: Troy Engel <troyengel@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
If XDG_SESSION_TYPE is not set, then $XDG_SESSION_TYPE will become nothing,
which means the test:
if [ $XDG_SESSION_TYPE = "wayland" ];
turns into
if [ = "wayland" ];
And will cause a shell error. Adding quotes around "$XDG_SESSION_TYPE"
changes an empty $XDG_SESSION_TYPE into:
if [ "" = "wayland" ];
which the shell can understand.
Link: http://lore.kernel.org/linux-trace-devel/20190722113707.156a099f@gandalf.local.home
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204261
Fixes: 9b1208c4e ("kernel-shark-qt: Workaround for running as Root on Wayland")
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The new Logo is shown on the title page of the doxygen documentation.
The two new icons are installed ("jumping shark" and "fin only").
The "jumping shark" icon is used by default.
Link: http://lore.kernel.org/linux-trace-devel/20190607095056.14666-3-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
All graphics files of the KernelShark's logos and icons have been
contributed to the project by Stela Stamenkova. This artistic work
can be used under the terms of the Creative Commons (BY) license.
Link: http://lore.kernel.org/linux-trace-devel/20190607095056.14666-2-ykaradzhov@vmware.com
Suggested-by: Stela Stamenkova <sstamenkova@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
If the capture process finishes with an error the _captureError() slot
will print an error message. We do not need to print identical message
in _captureFinished().
However, we have to keep in mind that the process that we started is
"pkexec" and the capture dialog is a child process of "pkexec". So if
the capture dialog failed to start or crashed the "pkexec" process
itself will have a normal exit, however its return value will be
different from 0 (it will just pass the return value of the capture
dialog executable). In this case _captureError() is not triggered,
but we still want to see an error message.
Link: http://lore.kernel.org/linux-trace-devel/20190710153906.32048-1-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
[ Fixed '||' to be '&&' as Yordan asked ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
We want all operations over the graphs (like Zoom or Scroll) to be
protected for the case when no data is loaded or no graphs are plotted.
Link: http://lore.kernel.org/linux-trace-devel/20190717085306.12393-3-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The function ksmodel_init() is to initialize the kshark_trace_histo
structure to zero. Currently it does it via each field. It is safer to use
memset() that will guarantee that the entire structure is set to zeros or
NULLs if new fields are added. This is required because there's places in
the code that check if a field is NULL or zero to determine if it should be
set or not.
Link: http://lkml.kernel.org/r/20190717085306.12393-2-y.karadz@gmail.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204195
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
It looks more like a Qt bug, but sometimes the automatic resize of
the table widget done in KsTraceViewer::_resizeToContents() has the
parasitic effect to select the first row of the table (making the row
green). If this is happening clear the selection by hand.
Link: http://lore.kernel.org/linux-trace-devel/20190715132042.5154-3-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The "Graph follows" checkbox controls if the Graph widget follows or not
the change of the Active marker made from the View widget (the text data
table).
In the same time, when the user clicks on the checkbox switching it from
Unchecked to Checked, a signal is send to the Graph widget to make sure
that it will visualize the current position of the Active marker. When
sending this signal, we currently use the iterator of the search results
list, which is wrong because of two reasons. First, the search results
list can be empty, which will trigger a segmentation fault, as reported
by Valentin Schneider. But even more important is that nothing guarantees
that when the checkbox is checked, the marker and the iterator both point
to the same trace entry. Note that the iteration over the search results
is only one of the possible ways to change the marker.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204139
Link: http://lore.kernel.org/linux-trace-devel/20190715132042.5154-2-y.karadz@gmail.com
Reported-By: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The Qt dialog boxes require '<br>' to print a new line but consoles require
a '\n'. Instead of printing '<br>' to the console or '\n' to the dialog,
always have the '\n' turn into '<br>' for the dialog and all '<br>' turn
into '\n' for the console.
Link: http://lkml.kernel.org/r/20190710134725.599995325@goodmis.org
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When kshark-record fails, report the standard error which can be very useful
for debugging the issue that when wrong. For example, after removing the
kshark lib functions, instead of just having "Unknow error" print when
kshark-record dialog fails, I now get:
/usr/local/bin/kshark-record: error while loading shared libraries: libkshark-gui.so.0.9.8: cannot open shared object file: No such file or directory
Link: http://lkml.kernel.org/r/20190710134725.436998774@goodmis.org
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The message is not appropriate, although it is most likely that the
error occurs because the user didn't install KernelShark and it runs
the executable from its build location.
[ Steve: Although I hit this warning without needing a make install ;-) ]
Link: http://lore.kernel.org/linux-trace-devel/20190709155650.2345-7-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
[ Removed "duplicate" print of it as well ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
It turns out that if the kshark-record dialog does not show up for some
reason, then without this "duplicate" message, the user gets no message at
all to why the dialog did not appear.
Link: http://lkml.kernel.org/r/20190710134725.144595473@goodmis.org
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Most likely the reason for this error to occur is that the KernelShark GUI
is not open (was closed).
Link: http://lore.kernel.org/linux-trace-devel/20190709155650.2345-9-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This is done because we do not want to show error messages if the Capture
dialog is not closed.
Link: http://lore.kernel.org/linux-trace-devel/20190709155650.2345-8-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
If the capture process finishes with an error the _captureError() slot
will print an error message. We do not need to print identical message
in _captureFinished().
Link: http://lore.kernel.org/linux-trace-devel/20190709155650.2345-6-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In the case when the recording process failed, the Capture dialog should
not send a signal to the KernelShark GUI to open a new tracing data file.
Link: http://lore.kernel.org/linux-trace-devel/20190709155650.2345-5-y.karadz@gmail.com
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Do not include all events belonging to a given system if the whole system
is selected. Add only the name of the system instead. Do not specify a
plugin if the selected plugin is "nop".
Link: http://lore.kernel.org/linux-trace-devel/20190709155650.2345-4-y.karadz@gmail.com
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
A new method is added to the class KsEventsCheckBoxWidget. It returns
a list of strings containing all selected events. If the whole system
is selected (the top level checkbox is checked), only the name of the
system is added to the list.
Link: http://lore.kernel.org/linux-trace-devel/20190709155650.2345-3-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
[ Added space between for and '(' ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In kshark_config_doc_get() if the outputted document is of type
KS_CONFIG_STRING, do not try to free the old string before setting
the new one. Note that those strings are owned by the json object.
Link: http://lore.kernel.org/linux-trace-devel/20190709155650.2345-2-y.karadz@gmail.com
Fixes: b3b5b6504b1 ("kernel-shark-qt: Add I/O for configuration data.")
Reported-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Commit d74f3845ddebf0 ("trace-cmd: Make the version defines part of
tc-version.h") created a VERSION_GIT define to include in the trace.dat
file. It would also be helpful to have this displayed with the --version
option too.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The HTML version of kernelshark is for the old GTK kernelshark. Change it to
the new version.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Having all target installation destinations given in one instruction may
result in an error in the case when some of the third-party dependencies
are missing. This will happen because you are trying to install a target
that hasn't been built.
Link: http://lore.kernel.org/linux-trace-devel/20190705141031.20239-3-y.karadz@gmail.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The Advanced filtering dialog shows a table of the already loaded filters.
The new line that is added at the end of the string breaks the alignment
of the last column of this tables.
Link: http://lore.kernel.org/linux-trace-devel/20190705141031.20239-2-y.karadz@gmail.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Fixing warnings coming from:
../examples/datahisto.c
../src/KsTraceGraph.cpp
../src/libkshark.c
Link: http://lore.kernel.org/linux-trace-devel/20190614135045.17223-4-ykaradzhov@vmware.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203869
Reported-by: Alan Mikhak <alanmikhak@gmail.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
All time stamps of the trace records are coded with 64 bits, however
on some systems the size_t type can be 32 bits.
Link: http://lore.kernel.org/linux-trace-devel/20190614135045.17223-3-ykaradzhov@vmware.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203869
Reported-by: Alan Mikhak <alanmikhak@gmail.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
On a first glance this patch may looks like reverting commit
9336dd6bcd38 (kernel-shark: Fix a bug in ksmodel_set_next_bin_edge())
The point is that for the last bin we want to increment its upper edge
used when checking if the bin is empty, but we do not want to touch
the lower edge time used by kshark_find_entry_by_time().
Link: http://lore.kernel.org/linux-trace-devel/20190614135045.17223-2-ykaradzhov@vmware.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203869
Fixes: 9336dd6bcd38 ("kernel-shark: Fix a bug in ksmodel_set_next_bin_edge()")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Add an option to the Makefile called "BUILD_TYPE" that is passed to the CMake
commands to change how kernelshark is built. The current options are:
make BUILD_TYPE=Debug gui - for "-g" option
make BUILD_TYPE=Release gui - for "-O3" option
make BUILD_TYPE=RelWithDebInfo gui - for "-g -O2" option (default)
make BUILD_TYPE=MinSizeRel gui - for "-Os" option
By default, BUILD_TYPE is set to RelWithDebInfo.
Also change the CMakeLists.txt to use RelWithDebInfo as the default
instead of just Debug.
Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
A make clean should clean up the cmake files as well.
Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The top level git tree's Makefile has code added to build the cmake portion
of KernelShark. But the README does not document the process. Bring the
README up to speed with how to actually build KernelShark.
Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
A special build type dedicated for package maintainers is added.
By default this build type adds the "-O3" compiler flag. Users
can chose their own compiler flags by providing the corresponding
CMAKE_XXXX_FLAGS_PACKAGE Command-Line options.
If no types is specified, the build type will be "Debug".
Link: http://lore.kernel.org/linux-trace-devel/20190708091945.439-1-y.karadz@gmail.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The full path to the build directory (which is random for every user)
is embedded in the final binary. This is a no-no for some Linux distros
which are requiring that the finished binaries should not have such paths
embedded in them.
Link: http://lore.kernel.org/linux-trace-devel/20190614132609.16465-3-ykaradzhov@vmware.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203187
Reported-by: Troy Engel <troyengel@gmail.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The debug flags by design embed the build paths, but the distro package
binaries should not have such paths embedded in them.
Link: http://lore.kernel.org/linux-trace-devel/20190614132609.16465-2-ykaradzhov@vmware.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203187
Suggested-by: Troy Engel <troyengel@gmail.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
readlink()
The buffer, returned by readlink() API, is not guaranteed to be a null terminated string.
Explicitly adding '\0' at the end of the buffer is recommended, to ensure the string is
null terminated and to avoid possible buffer overruns.
Link: http://lore.kernel.org/linux-trace-devel/20190703121644.18680-1-tz.stoyanov@gmail.com
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Tested-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The put_together_file() 'out' error path uses uninitialized handle.
Unconditionally initialize handle.
Link: http://lore.kernel.org/linux-trace-devel/20190627152710.177848-1-gthelen@google.com
Fixes: 9ed499fccef5 ("trace-cmd: Fix record --date flag when sending tracing data to a listener")
Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
write_record() uses an uninitializedd 'len' when record->size is 0. I'm
not sure how likely this case is.
To be safe and silence compiler warning, unconditionally initialize len.
Link: http://lore.kernel.org/linux-trace-devel/20190627152502.174918-1-gthelen@google.com
Fixes: 87d2a344a ("trace-cmd: Add split feature")
Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Neither 16-bit knuth_hash16() nor the 32-bit knuth_hash() are used.
Delete them both.
And rename the remaining function: knuth_hash8() => knuth_hash()
Link: http://lore.kernel.org/linux-trace-devel/20190629062752.204113-1-gthelen@google.com
Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
case trace file is loaded.
A major speed regression in trace-cmd v2.8 is reported by Johannes Berg
when parsing a huge trace.dat file:
"I have a ~1.7G file with just under 620k events (not exactly big by our standards),
and parsing speed (with -N to disable plugins) goes from ~4.5 seconds on commit
1ad32c24746 to >>4.5 minutes (I aborted there) on master.
I was talking to Steven about another issue, and he pointed me to
commit c2fc2bc296f7. Reverting that on master makes it take ~2 seconds,
so that'd actually be an improvement."
Proposed solution: do not free pages from "struct page **pages" lookup table
in struct cpu_data, in case a trace file is loaded. This reverts the behavior
for this use case, as it was before commit c2fc2bc296f7.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203411
Link: http://lore.kernel.org/linux-trace-devel/20190619114922.3169-1-tz.stoyanov@gmail.com
Fixes: c2fc2bc296f7 ("trace-cmd: Fix crash when trace-cmd is executed with args profile -F sleep 1")
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Update the Makefile to show all new changes are on the next development
cycle.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
add_reset_file()
If get_file_content() returns NULL, because the file does not exist or for
any other reason, it will cause add_reset_file() to trigger a SEGSEGV due to
using a NULL pointer. Only call add_reset_file() if get_file_content()
actually returns something.
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Reviewed-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
New kernels will allow function graph tracer to be used in an instance,
which means that the max_graph_depth file will be per instance and not just
the top level file. Make the max_graph_depth associated to the instance and
not part of the trace record context.
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Reviewed-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The order-only prerequisit to $(bdir)/include has a typo of "$(bidr)"
instead of being "$(bdir)"
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Reviewed-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The description of "check-events" is incorrectly stated as "check-format".
Link: http://lore.kernel.org/linux-trace-devel/20190607183658.5605-1-mudongliangabcd@gmail.com
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Move the version string creations as part of the tc-version.h file, and have
trace-record.c include and use that. The VERSION_STRING is already defined
and obsoletes TRACECMD_VERSION. For consistency, use VERSION_GIT to define
the git sha1. Also, add logic to detect if the source file is a git repo,
and use "not-a-git-repo" as the sha1 if it is not found. Add a "+" to the
end of the git sha1 if the repo has modifications in it.
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Fix compiler error at KsSession.cpp:457:30 on Raspberry Pi 3
Fix by changing the type of local variable 'pos' from uint64_t to
size_t in KsSession::loadDualMarker().
KsSession.cpp:457:30: error: no matching function for call to
‘KsSession::_getMarker(const char [6], uint64_t*)’
if (_getMarker("markA", &pos)) {
^
In file included from KsSession.cpp:14:0:
KsSession.hpp:97:7: note: candidate:
bool KsSession::_getMarker(const char*, size_t*)
bool _getMarker(const char* name, size_t *pos);
^~~~~~~~~~
KsSession.hpp:97:7: note: no known conversion for
argument 2 from ‘uint64_t* {aka long long unsigned int*}’
to ‘size_t* {aka unsigned int*}’
Link: http://lore.kernel.org/linux-trace-devel/20190612035902.16366-1-amikhak@wirelessfabric.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203873
Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Alan Mikhak <amikhak@wirelessfabric.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Now that the trace.dat file can save the version of the executable that was
used to create it, save that information. This will be useful if a user has
a problem with a trace.dat file. It can let the developers know what version
was used to create it. We need a way to extract this information. Adding a
new "--version" to trace-cmd report will display the saved version in the
trace.dat file if it exists.
Link: http://lore.kernel.org/linux-trace-devel/20190610212706.2505bffe@oasis.local.home
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Add metadata when recording to the output trace about trace-cmd's version and
git commit. When debugging this can be useful to know which version of trace-cmd
recorded this trace.dat file.
Link: http://lore.kernel.org/linux-trace-devel/20190604124826.6716-1-kaslevs@vmware.com
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=203547
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When pipes are used for communication between trace-cmd main
thread and per-cpu recorder threads, there is a possible race
condition in stop_threads(), which can cause a deadlock between
the main thread and cpu recorder thread:
In trace_stream_read(), the select() call can return 0 if threads
have no data to send. This will force stop_threads() to stop reading
the thread's pipes and enter a waitpid() loop, to wait for all threads
to be terminated. However, there is a case when some threads are still
flushing its data - tracecmd_flush_recording() tries a blocking write()
to the pipe. A dead lock appears - the cpu thread is blocked in write(),
as its buffer is full and no one is reading it. The main thread is blocked
in waitpid(), to wait the same thread to exit.
The deadlock can be (randomly) observed with the command
"trace-cmd profile -p function -F sleep 10"
The proposed fix removes the select timeout, makes the call blocking,
to ensure the threads are flushed its data before going in waitpid() loop.
Link: http://lore.kernel.org/linux-trace-devel/20190605111937.17894-2-tstoyanov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Yordan Karadzhov (2):
kernel-shark: Add new dataloading method to be used by the NumPu interface
kernel-shark: Use full paths for non-standard library headers
|
|
All header files included in the public interfaces of the trace-cmd
and KernelShark libraries have to use full path when including other
non-standard library headers. This will be useful if someone wants to use
those public interfaces from there installation location.
You may need to clean Cmake's cache after aplaying this patch:
cd kernel-shark/build
./cmake_clean.sh
cmake ..
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
|
|
The new function loads the content of the trace data file into a
table / matrix, made of columns / arrays of data having various integer
types. Later those arrays will be wrapped as NumPy arrays.
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
|
|
When trace-cmd is running in "profile" mode, trace files are not generated.
Instead, pipes are used to collect trace data from recorder threads. Some
internal functions, originally designed for working with files, are reused
in pipes use case:
init_cpu()
allocate_page()
get_next_page()
There was an undesired behaviour in those functions, when working with pipes,
which causes the segmentation fault.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203411
Link: http://lore.kernel.org/linux-trace-devel/20190605115046.20444-1-tstoyanov@vmware.com
Fixes: 62e82cc6cdc9 ("trace-cmd: Use lookup table instead of link list for pages")
./trace-cmd profile -F sleep 1
Segmentation fault (core dumped)
back trace:
0 allocate_page (handle=0x4a1a10, cpu=0, offset=12288) at trace-input.c:927
1 0x000000000042d2aa in get_page (handle=0x4a1a10, cpu=0, offset=12288) at trace-input.c:1116
2 0x000000000042d40d in get_next_page (handle=0x4a1a10, cpu=0) at trace-input.c:1142
3 0x000000000042e339 in tracecmd_peek_data (handle=0x4a1a10, cpu=0) at trace-input.c:1776
4 0x000000000042e6d4 in tracecmd_read_data (handle=0x4a1a10, cpu=0) at trace-input.c:1841
5 0x0000000000424d82 in trace_stream_read (pids=0x47b7d0, nr_pids=8, tv=0x7fffffffd3c0) at trace-stream.c:105
6 0x000000000040aa1f in trace_waitpid (type=TRACE_TYPE_STREAM, pid=24759, status=0x7fffffffd408, options=1) at trace-record.c:1114
7 0x000000000040b151 in run_cmd (type=TRACE_TYPE_STREAM, argc=2, argv=0x7fffffffd600) at trace-record.c:1331
8 0x0000000000412ffd in record_trace (argc=5, argv=0x7fffffffd5e8, ctx=0x7fffffffd470) at trace-record.c:5065
9 0x000000000041338d in trace_profile (argc=5, argv=0x7fffffffd5e8) at trace-record.c:5199
10 0x0000000000408bc5 in main (argc=5, argv=0x7fffffffd5e8) at trace-cmd.c:118
The problem seems to be in the lookup table "struct page **pages" in struct cpu_data.
In case pipes are used with this tracecmd_input handler, only a single page is
allocated in this lookup table. Later, when get_page() is called, there is use
case where more pages are addressed (in the backtrace above, the page with
index 3 is addressed, cpu_data->pages[3])
trace-cmd: current (git20190424)
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The erroneous case, when the memory allocation failed during data loading,
hasn't been properly handled.
Link: http://lore.kernel.org/linux-trace-devel/20190523150946.30769-4-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
get_records() can return negative error codes. This means that we alway
have to use signed integer types for the "data size" variables / fields.
Link: http://lore.kernel.org/linux-trace-devel/20190523150946.30769-3-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
No functional changes in this patch.
Link: http://lore.kernel.org/linux-trace-devel/20190523150946.30769-2-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Markers can point to entries that are filtered out. In such a case
the filtered marker is plotted using a dashed line.
Link: http://lore.kernel.org/linux-trace-devel/20190515190911.20755-7-ykaradzhov@vmware.com
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Some of the components of the plots haven't been properly scaled
when displayed on high screen resolution.
Link: http://lore.kernel.org/linux-trace-devel/20190515190911.20755-6-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Use the QStandardPaths class provided by Qt in order to guarantee that
the location of the cached data is XDG compliant.
Link: http://lore.kernel.org/linux-trace-devel/20190515190911.20755-3-ykaradzhov@vmware.com
Suggested-by: Troy Engel <troyengel@gmail.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The definitions of KS_APP_NAME and KS_ICON are used to derive standard
installation paths for the KernelShark libraries, plugins and icons.
The patch combines improvements suggested by Troy Engel and Bas van Dijk.
Link: http://lore.kernel.org/linux-trace-devel/20190515190911.20755-2-ykaradzhov@vmware.com
Suggested-by: Troy Engel <troyengel@gmail.com>
Suggested-by: Bas van Dijk <v.dijk.bas@gmail.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Resolve linker relocation error when linking libkshark.so.0.9.8
with cmake on armv7l, aarch64, and some x86_64 platforms.
Ubuntu 16.04 (xenial) on x86_64:
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
Debian 9.8 (stretch) on x86_64:
relocation R_X86_64_TPOFF32 against `seq' can not be used when making
a shared object; recompile with -fPIC
Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Alan Mikhak <amikhak@wirelessfabric.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When clicked, the Bugzilla will be opened in the appropriate Web browser
for the user's desktop environment.
Link: http://lore.kernel.org/linux-trace-devel/20190502124536.32463-2-ykaradzhov@vmware.com
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This is needed in the case when the session was saved at different screen
resolution.
Link: http://lore.kernel.org/linux-trace-devel/20190502124536.32463-1-ykaradzhov@vmware.com
Reported-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
If kshark-record has been started from its installation location it will
use the installed version of trace-cmd. Otherwise the trace-cmd executable
found by Cmake when building KernelShark (see FindTraceCmd.cmake) will be
used.
Link: http://lore.kernel.org/linux-trace-devel/20190502124009.32208-7-ykaradzhov@vmware.com
Suggested-by: Troy Engel <troyengel@gmail.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The application will remember the used file paths across different
executions.
Link: http://lore.kernel.org/linux-trace-devel/20190502124009.32208-6-ykaradzhov@vmware.com
Suggested-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
KS_DIR is no longer used, so we do not need to define it in the
Cmake-generated header file.
Link: http://lore.kernel.org/linux-trace-devel/20190502124009.32208-5-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
If the application has not been started from its installation location
and the directory
app_file_path + "../../kernel-shark/lib"
exists, all build-in plugins will be loaded from this directory. In any
other case all build-in plugins will be loaded from
_INSTALL_PREFIX/lib/kshark/plugins/
Link: http://lore.kernel.org/linux-trace-devel/20190504130702.27755-1-ykaradzhov@vmware.com
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
If the application has been started from its installation location,
all Open File dialogs will start at ${HOME}. Otherwise the dialogs will
start at ${PWD}. If a given dialog has been used already to select a file,
next time the dialog will start in the directory of this file.
Link: http://lore.kernel.org/linux-trace-devel/20190502124009.32208-3-ykaradzhov@vmware.com
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
To be used to check if the aplication runs from its installation location.
Link: http://lore.kernel.org/linux-trace-devel/20190502124009.32208-2-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In preperation for the python plugin to work with python3,
apply the 2to3 print transformation on the python files.
In python3 print is a function so needs to be bracketted.
This is safe to do because the syntax is compatible with python2 as well
Link: http://lore.kernel.org/linux-trace-devel/20190503161541.15773-1-jkacur@redhat.com
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Fix the potential resource leak of msg_handle by calling
tracecmd_msg_handle_close before returning in an error path
Link: http://lore.kernel.org/linux-trace-devel/20190503142449.9936-1-jkacur@redhat.com
Fixes: 35bfedc66b99 ("trace-cmd msg: Create a msg_handle to pass around for saved state")
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When a development version of trace-cmd is built and run on the machine,
by default it loads all plugins from predefined drierctories :
(install_preffix)/lib/traceevent/plugins
~/.traceevent/plugins
the path specified in TRACEEVENT_PLUGIN_DIR environment variable.
Thus, the development plugins will not be loaded. To simplify the development
process, a new logic is added:
At plugins load time, check the location of trace-cmd application and look
for "plugins" directory around it. If found, load plugins from it. Those
pluigins will be loaded last, so in case of duplication the "development"
plugins win.
Link: http://lore.kernel.org/linux-trace-devel/20190423143344.30645-1-tstoyanov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
if (zoom_in && (int) range * (1. - r) < histo->n_bins * 5)
The line above has two bugs:
- 64 bit type (size_t) is casted to 32 bit (int)
- Type cast operator has a higher precedence than the multiplication
operator, hence "(int) range * (1. - r)" is a floating point number
Link: http://lore.kernel.org/linux-trace-devel/20190422123753.3821-1-ykaradzhov@vmware.com
Reported-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Fixes: bedcff1165 ("kernel-shark: Fix a bug in ksmodel_zoom")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
./kernelshark -l will load directly the Last Session
Link: http://lore.kernel.org/linux-trace-devel/20190419135036.19340-7-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
If the data-set is small we do not want to have the overhead added by
the update of the progress bar. Because of this we bypass the state
switching of the FSM. However, in this case the the search condition
has to be updated by hand.
Link: http://lore.kernel.org/linux-trace-devel/20190419135036.19340-8-ykaradzhov@vmware.com
Reported-by: Slavomir Kaslev <kaslevs@vmware.com>
Fixes: 1615b02b (kernel-shark-qt: Optimize the search in a case of a small data-set)
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
KS_CONF_DIR is no longer used, so we do not need to define it in the
Cmake-generated header file.
Link: http://lore.kernel.org/linux-trace-devel/20190419135036.19340-3-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
By default the "Last session" configuration file will be saved in
${HOME}/.cache/kernelshark. If ${HOME}/.cache/kernelshark doesn't exist,
it will be created automatically. The user can select another directory
to be used to store the cached data. This can be done by setting the
environment variable KS_USER_CACHE_DIR. In this case if the path (the
value of KS_USER_CACHE_DIR) doesn't exist the user will be asked before
create it.
Link: http://lore.kernel.org/linux-trace-devel/20190419135036.19340-2-ykaradzhov@vmware.com
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Add trace-cmd --no-filter option that disables filtering out of trace-cmd
recording processes from the trace.
Link: http://lore.kernel.org/linux-trace-devel/20190417183157.8776-2-kaslevs@vmware.com
Tested-by: Phil Auld <pauld@redhat.com>
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The application, which uses libtraceevent, should track itself the number of
failures while parsing the event files. The libtraceevent APIs return error
in case of such failure. The application can check for it and track the
parsing failures, if needed.
Introduced changes:
- traceecent library: remove the parsing failures APIs and logic.
- trace-cmd library:
Added new parameter "int *parsing_failures" to tracecmd_fill_local_events().
Added new parameter "int parsing_failures" to internal struct tracecmd_input
and new API tracecmd_get_parsing_failures() to access it.
Modified the logic in tracecmd_read_headers() to track failures while parsing
the event files.
- trace-cmd application:
use the new trace-cmd library APIs to check the number of parsing failures.
Link: http://lore.kernel.org/linux-trace-devel/20190417162630.32240-1-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Express pid filters as allowed/disallowed filter ranges
(pid>=100&&pid<=103)
instead of specifying them per pid
(pid==100||pid==101||pid==102||pid==103)
This makes the size of the resulting filter smaller (and faster) and avoids
overflowing the filter size limit of one page which we can hit on bigger
machines (say >160 CPUs).
Link: http://lore.kernel.org/linux-trace-devel/20190417130959.10064-2-kaslevs@vmware.com
Reported-by: Phil Auld <pauld@redhat.com>
Tested-by: Phil Auld <pauld@redhat.com>
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Users can use trace-cmd to test specific filters, with the command
trace-cmd record -F <filter> -T
When trace-cmd runs in this "test filter" mode, after processing the filter
string, the resulting filter will be displayed for each event. It should not run
the actual trace, but exit after all filters are processed. This exit() was
originally performed in the context of libtraceevent, but removed from there as
a library function should not force the application to exit. The logic was
moved to trace-cmd application.
Link: http://lore.kernel.org/linux-trace-devel/20190415125823.4011-2-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
There was a missing comparison with 0 when checking if type is "s64" or
"u64". Therefore, the body of the if-statement was entered if "type" was
"u64" or not "s64", which made the first strcmp() redundant since if
type is "u64", it's not "s64".
If type is "s64", the body of the if-statement is not entered but since
the remainder of the function consists of if-statements which will not
be entered if type is "s64", we will just return "val", which is
correct, albeit at the cost of a few more calls to strcmp(), i.e., it
will behave just as if the if-statement was entered.
If type is neither "s64" or "u64", the body of the if-statement will be
entered incorrectly and "val" returned. This means that any type that is
checked after "s64" and "u64" is handled the same way as "s64" and
"u64", i.e., the limiting of "val" to fit in for example "s8" is never
reached.
This was introduced in the kernel tree when the sources were copied from
trace-cmd in commit f7d82350e597 ("tools/events: Add files to create
libtraceevent.a"), and in the trace-cmd repo in 1cdbae6035cei
("Implement typecasting in parser") when the function was introduced,
i.e., it has always behaved the wrong way.
Detected by cppcheck.
Link: http://lkml.kernel.org/r/20190412142250.20595-7-acme@kernel.org
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Clark Williams <williams@redhat.com>
Cc: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Fixes: f7d82350e597 ("tools/events: Add files to create libtraceevent.a")
Link: http://lkml.kernel.org/r/20190409091529.2686-1-rikard.falkeborn@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
libtraceevent from pevent to tep
"pevent" to "tep" renaming of:
- all "pevent" input arguments of libtraceevent internal functions.
- all local "pevent" variables of libtraceevent.
This makes the implementation consistent with the chosen naming
convention, tep (trace event parser), and will avoid any confusion with
the old pevent name
Link: http://lore.kernel.org/linux-trace-devel/20190409075024.30512-6-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/linux-trace-devel/20190401132111.13727-5-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164344.944953447@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
tep_event_filter to "tep"
The member "pevent" of the struct tep_event_filter is renamed to "tep".
This makes the struct consistent with the chosen naming convention:
tep (trace event parser), instead of the old pevent.
Link: http://lore.kernel.org/linux-trace-devel/20190409075024.30512-5-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/linux-trace-devel/20190401132111.13727-4-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164344.785896189@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
to "tep"
The member "pevent" of the struct tep_event is renamed to "tep". This
makes the struct consistent with the chosen naming convention:
tep (trace event parser), instead of the old pevent.
Link: http://lore.kernel.org/linux-trace-devel/20190409075024.30512-4-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/linux-trace-devel/20190401132111.13727-3-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164344.627724996@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
pevent to tep
Input arguments of libtraceevent APIs are renamed from "struct
tep_handle *pevent" to "struct tep_handle *tep". This makes the API
consistent with the chosen naming convention: tep (trace event parser),
instead of the old pevent.
Link: http://lore.kernel.org/linux-trace-devel/20190409075024.30512-3-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/linux-trace-devel/20190401132111.13727-2-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164344.465573837@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Rename some traceevent APIs for consistency:
tep_pid_is_registered() to tep_is_pid_registered()
tep_file_bigendian() to tep_is_file_bigendian()
to make the names and return values consistent with other tep_is_... APIs
tep_data_lat_fmt() to tep_data_latency_format()
to make the name more descriptive
tep_host_bigendian() to tep_is_bigendian()
tep_set_host_bigendian() to tep_set_local_bigendian()
tep_is_host_bigendian() to tep_is_local_bigendian()
"host" can be confused with VMs, and "local" is about the local
machine. All tep_is_..._bigendian(struct tep_handle *tep) APIs return
the saved data in the tep handle, while tep_is_bigendian() returns
the running machine's endianness.
All tep_is_... functions are modified to return bool value, instead of int.
Link: http://lore.kernel.org/linux-trace-devel/20190409075024.30512-2-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20190327141946.4353-2-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164344.288624897@goodmis.org
[ Removed some extra parenthesis around return statements ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
This patch removes call to exit() from tep_filter_add_filter_str(). A
library function should not force the application to exit. In the
current implementation tep_filter_add_filter_str() calls exit() when a
special "test_filters" mode is set, used only for debugging purposes.
When this mode is set and a filter is added - its string is printed to
the console and exit() is called. This patch changes the logic - when in
"test_filters" mode, the filter string is still printed, but the exit()
is not called. It is up to the application to track when "test_filters"
mode is set and to call exit, if needed.
Link: http://lore.kernel.org/linux-trace-devel/20190408152340.12450-6-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20190326154328.28718-9-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164344.121717482@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
This patch removes trivial filter tep APIs:
enum tep_filter_trivial_type
tep_filter_event_has_trivial()
tep_update_trivial()
tep_filter_clear_trivial()
Trivial filters is an optimization, used only in the first version of
KernelShark. The API is deprecated, the next KernelShark release does
not use it.
Link: http://lore.kernel.org/linux-trace-devel/20190408152340.12450-5-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20190326154328.28718-4-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164343.968458918@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
As return is not a function we do not need parenthesis around the return
value. Also, a function returning bool does not need to add !!.
Link: http://lore.kernel.org/linux-trace-devel/20190408152340.12450-4-tstoyanov@vmware.com
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Link: http://lkml.kernel.org/r/20190401164343.817886725@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
tep_handler fields
As struct tep_handler definition is not exposed as part of libtraceevent
API, its fields cannot be accessed directly by the library users. This
patch implements new APIs, which can be used to access the struct
tep_handler fields:
tep_get_event() - retrieves an event pointer at a specific index
tep_get_first_event() - is modified to use tep_get_event()
tep_clear_flag() - clears a tep handle flag
tep_test_flag() - test if a given flag is set
tep_get_header_timestamp_size() - returns the size of the timestamp stored
in the header.
tep_get_cpus() - returns the number of CPUs
tep_is_old_format() - returns true if data was created by an
older kernel with the old data format
tep_set_print_raw() - have the output print in the raw format
tep_set_test_filters() - debugging utility for testing tep filters
Link: http://lore.kernel.org/linux-trace-devel/20190408152340.12450-3-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/linux-trace-devel/20190325145017.30246-4-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164343.679629539@goodmis.org
[ Renamed some newly added "pevent" to "tep" ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
APIs descriptions should describe the purpose of the function, its
parameters and return value. While working on man pages implementation,
I noticed mismatches in the descriptions of few APIs. This patch
changes the description of these APIs, making them consistent with the
man pages:
- tep_print_num_field()
- tep_print_func_field()
- tep_get_header_page_size()
- tep_get_long_size()
- tep_set_long_size()
- tep_get_page_size()
- tep_set_page_size()
Link: http://lore.kernel.org/linux-trace-devel/20190408152340.12450-2-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/linux-trace-devel/20190325145017.30246-2-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164343.396759247@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
The function is not meant to have arguments, so it must explicitly
state this. A functions taking unspecified list of parameters will
be a problem for the Pythion interface.
Link: http://lore.kernel.org/linux-trace-devel/20190327160323.31654-2-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
const char *lib = plugin.toStdString().c_str();
This line is a bad idea because the returned array may (will) be
invalidated when the destructor of std::string is called.
Link: http://lore.kernel.org/linux-trace-devel/20190326133914.18884-1-ykaradzhov@vmware.com
Fixes: 18cf94f48 ("kernel-shark-qt: Add KernalShark Utils")
Suggested-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The CMAKE build system of KernelShark performs automated search for the
trace-cmd libraries, headers and executable before building the GUI.
The new order of the list of directories to search in is the following:
1. ${TRACE_CMD}/ ($TRACE_CMD is an environment variable)
2. CMAKE_SOURCE_DIR/../
3. Platform / system specific locations
Link: http://lore.kernel.org/linux-trace-devel/20190313152220.22026-2-ykaradzhov@vmware.com
Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Kernelshark is a system tool, thus should by classified as System application.
The template desktop file is modified to set Kernelshark in "System" category.
Link: http://lore.kernel.org/linux-trace-devel/20190329140514.1373-1-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Installation prefix of kernelshark should not be hardcoded, it should be
configurable at build time. As kernelshark and trace-cmd are built together,
they should share the same installation prefix. The patch removes hardcoded
/usr/local prefix from kernelshark make files and replaces it with the one,
specified in the top Makefile.
Note: after applying the patch, kernel-shark/build/cmake_clean.sh should be
run, to ensure that cmake cache is cleared.
Link: http://lore.kernel.org/linux-trace-devel/20190329150319.7176-1-tstoyanov@vmware.com
Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Tested-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Now that all protocol V3 messages (besides SEND_DATA) use the buffer for text,
it makes sense to have it declared as such and drop a few casts.
This also takes care of undefined behavior caused by void pointer arithmetic in
tracecmd_msg_data_send()/tracecmd_msg_read_data().
Link: http://lore.kernel.org/linux-trace-devel/20190322162635.30689-1-kaslevs@vmware.com
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The cpu variable was not indented correctly.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
clock_gettime() requires -lrt for glibc < 2.17. Add it so older systems can
still build.
Fixes: 42e33cf0e53b ("trace-cmd: improve the accuracy of date to ts mapping")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In particular, handle the case when the size of the data is smaller
than the required margin.
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-13-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
ksmodel_set_bin_counts() should not crash in the case when all
bins of the model, except the Upper Overflow bin, are empty.
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-12-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Sometimes when we save the session QSplitter::sizes() returns
0/0 ratio (no idea why). Later when we load the session the
0/0 ratio results in misbehavior of the splitter position.
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-11-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The tables of colors used by the OpenGL widget have to be updated
only when we load a new trace data file.
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-10-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The std::vector constructor used here makes a copy of the data, so
the memory used by the original array has to be freed.
This is a major leak because getTaskColorTable() gets called every
time when we redraw the plots.
BTW calling getTaskColorTable() every time when we redraw makes
no sense. This will be fixed in the following patch.
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-9-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Not sure how I missed to define this destructor before. The good
thing is that the GUI has only one GL widget, and this widget stays
alive for the whole duration of the program.
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-8-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When quoting in the output stream is disabled, the text of the
message is printed without quotations and without escaping of
non-printable characters.
example output with quoting enabled:
ERROR: "Unable to open trace data file for session mysession.json\n"
and with quoting disabled:
ERROR: Unable to open session description file mysession.json.
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-6-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Here we add proper handling of the case when the loading of the
session description file fails.
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-5-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The function has a better handling of the case when the session
description file cannot be loaded. It returns true on success,
otherwise false. We need this return flag in order to provide
adequate error message in the case when this operation fails.
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-4-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The error message, printed whene kshark_open_json_file() fails, puts
the period on a new line.
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-3-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
_restorSession* -> _restoreSession*
^
Link: http://lore.kernel.org/linux-trace-devel/20190314151012.905-2-ykaradzhov@vmware.com
Suggested-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
As msg_buf_len() is a single function helper, make it an inlined function.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Factor out common code computing message buffer length in a function.
No changes in behavior intended.
Link: http://lore.kernel.org/linux-trace-devel/20190315153326.5602-4-kaslevs@vmware.com
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Ports are now encoded as text in the buffer at the end of protocol V3 messages.
Link: http://lore.kernel.org/linux-trace-devel/20190315153326.5602-3-kaslevs@vmware.com
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Options are now encoded as text in the buffer at the end of protocol V3 messages.
Unrecognized options are logged and ignored by the listener to support adding
new options in the future.
Link: http://lore.kernel.org/linux-trace-devel/20190315153326.5602-2-kaslevs@vmware.com
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Just a small cosmetic improvement.
Link: http://lore.kernel.org/linux-trace-devel/20190313150717.21345-5-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The menu action in Tools that is used to manage all registered
plugins is renamed in order to avoid confusion with the "Add plugins"
menu action, implemented in the previous patch.
Link: http://lore.kernel.org/linux-trace-devel/20190313150717.21345-4-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The dialog allows the user to find and load the plugin's
library (.so file).
Link: http://lore.kernel.org/linux-trace-devel/20190313150717.21345-3-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The method can be used to register and load user-defined plugins.
All other previously loaded plugins will be reinitialized and the
data will be reloaded.
Link: http://lore.kernel.org/linux-trace-devel/20190313150717.21345-2-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
If tracecmd_msg_data_send() is passed a size of zero, the loop is not
entered, nothing is sent, but the ret variable is not initialized and
garbage can be sent out. The option code can call this with a size of zero,
which can cause an error report.
Just don't do anything in this case, and return a success.
Link: http://lore.kernel.org/linux-trace-devel/20190321194127.4ac47d99@gandalf.local.home
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In order to make libtraceevent into a proper library, its API
should be straightforward.
After a discussion with Steven Rostedt, we decided to rename a few APIs,
to have more intuitive names.
This patch renames tep_is_file_bigendian() to tep_file_bigendian().
Link: http://lore.kernel.org/linux-trace-devel/20190130104425.8813-6-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20181201040852.767549746@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In order to make libtraceevent into a proper library, its API
should be straightforward.
The tep_register_event_handler() functions returns -1 in case it
successfully registers the new event handler. Such return code is used
by the other library APIs in case of an error.
To unify the return logic of tep_register_event_handler() with the other
APIs, this patch introduces enum tep_reg_handler, which is used by this
function as return value, to handle all possible successful return
cases.
Link: http://lore.kernel.org/linux-trace-devel/20190130104425.8813-5-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20181201040852.628034497@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
trace_seq_vprintf() APIs
In order to make libtraceevent into a proper library, its API should be
straightforward.
The trace_seq_printf() and trace_seq_vprintf() APIs have inconsistent
returned values with the other trace_seq_* APIs.
This path changes the return logic of trace_seq_printf() and
trace_seq_vprintf() to return the number of printed characters, as the
other trace_seq_* related APIs.
Link: http://lore.kernel.org/linux-trace-devel/20190130104425.8813-4-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20181201040852.485792891@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This patch initializes the host_bigendian member of the tep_handle
structure with the byte order of the current host, when this handler is
created - in tep_alloc() API. We need this in order to remove the
tep_set_host_bigendian() API.
Link: http://lore.kernel.org/linux-trace-devel/20190130104425.8813-2-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20181201040852.216292134@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In order to make libtraceevent into a proper library, its API
should be straightforward.
After discussion with Steven Rostedt, we decided to remove the
tep_data_event_from_type() API and to replace it with tep_find_event(),
as it does the same.
Link: http://lore.kernel.org/linux-trace-devel/20190130104425.8813-7-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20181201040852.913841066@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In order to make libtraceevent a proper library, variables, data
structures and functions should have a unique prefix to prevent name
space conflicts. That prefix will be "tep_".
This patch renames 'struct cmdline' to 'struct tep_cmdline'.
Link: http://lore.kernel.org/linux-trace-devel/20190130104425.8813-3-tstoyanov@vmware.com
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20181201040852.358871851@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
There is no reason for find_wakeup_pid being non-static. In the same
time, because it is non-static, Doxygen complains about missing
documentation for this function.
Link: http://lore.kernel.org/linux-trace-devel/20190307154316.19194-4-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When zooming-in the model is supposed to avoid over-zooming by
recalculation the Scale factor. The new value of the Scale factor is
supposed to be such that the size of the bin cannot be smaller than 5
ns. This patch fixes a naive bug in the way the new scale value is
calculated. The bug was introduced in
f97e31f00 ("kernel-shark-qt: Introduce the visualization model used by the Qt-based KS")
but had no effect until
94efea960 ("kernel-shark-qt: Handle the case when the range of the model is too small")
because the ridiculous value of the Scale factor resulted in a very
small model range and because of this the modification of the model
was always rejected.
Link: http://lore.kernel.org/linux-trace-devel/20190307154316.19194-3-ykaradzhov@vmware.com
Fixes: f97e31f00 ("kernel-shark-qt: Introduce the visualization model used by the Qt-based KS")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
We instruct CMAKE to prefer using the legacy libGL library, if
available. Although this is the default choice, the latest versions
of CMAKE are printing a warning message in the case when no explicit
preference is provided.
Link: http://lore.kernel.org/linux-trace-devel/20190307154316.19194-2-ykaradzhov@vmware.com
Suggested-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This patch changes reset_max_latency() to utilize write_instance_file() for
writing set_event_pid instance file, instead of directly opening it. It also
changes the function to work per instance.
Link: http://lore.kernel.org/linux-trace-devel/20190311083339.21581-7-tstoyanov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
set_event_pid
The "trace-cmd reset" command should restore ftrace to its default state.
This patch sets "tracing/set_event_pid" to an empty string,
when the "trace-cmd reset" command is executed.
Link: http://lore.kernel.org/linux-trace-devel/20190311083339.21581-6-tstoyanov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This patch changes add_event_pid() to utilize write_instance_file() for
writing set_event_pid instance file, instead of directly opening it.
Link: http://lore.kernel.org/linux-trace-devel/20190311083339.21581-5-tstoyanov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
To allow for reset_max_latency() and add_filter_pid() to utilize
write_instance_file(), move it up before those functions. It is in a better
location now as well.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The "trace-cmd reset" command should restore ftrace to its default state.
This patch sets "tracing/trace_clock" to its default value "local",
when the "trace-cmd reset" command is executed.
Link: http://lore.kernel.org/linux-trace-devel/20190311083339.21581-4-tstoyanov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This patch fixes a segfault when "trace-cmd reset -a -d"
is executed and there is at least one ftrace instance created.
Link: http://lore.kernel.org/linux-trace-devel/20190311083339.21581-3-tstoyanov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The "trace-cmd reset" command should restore ftrace to its default state.
By default, "tracing/current_tracer" is "nop" and "tracing/tracing_on" is "1".
This patch sets "tracing/tracing_on" to 1, when the command "trace-cmd reset"
is executed.
Link: http://lore.kernel.org/linux-trace-devel/20190311083339.21581-2-tstoyanov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The sched_events plugin should not be totally disabled when the
wakeup events are missing. The initialization of the plugin must
fail only if the trace.dat file contains no sched_switch events.
Link: http://lore.kernel.org/linux-trace-devel/20190305143924.11056-4-ykaradzhov@vmware.com
Reported-by: Phil Auld <pauld@redhat.com>
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When the sched_events plugin fails to initialize not all the
memory allocated for the context of the plugin is freed properly.
The problem gets fixed by using the free_context helper function
defined in the previous patch.
Link: http://lore.kernel.org/linux-trace-devel/20190305143924.11056-3-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Fixes: 4f392730e ("kernel-shark-qt: Make Sched event plugin use its own data collections")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This static helper function makes the code of the plugin cleaner and
easier to read.
Link: http://lore.kernel.org/linux-trace-devel/20190305143924.11056-2-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Do an early out in print_stat() when `quiet` is set instead of rechecking it on
each loop iteration.
No changes in behavior intended.
Link: http://lore.kernel.org/linux-trace-devel/20190222180539.27439-3-kaslevs@vmware.com
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Initialize `struct timespec req` only once instead of on every loop iteration
since `sleep` is being constant throughout tracecmd_start_recording() execution.
No changes in behavior intended.
Link: http://lore.kernel.org/linux-trace-devel/20190222180539.27439-2-kaslevs@vmware.com
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The modification of the last bin of the model makes no sense (this is
my mistake). The comment above the code that is doing this modification
is partially correct, however it speaks about increasing the size of
the last bin, while the code below the comment changes the lower edge
of this bin. The actual increase of the size of the last bin is done in
ksmodel_set_upper_edge() where the lower edge of the Upper Overflow bin
gets shifted (max + 1). This effectively increases the size of the last bin.
Link: http://lore.kernel.org/linux-trace-devel/20190221124205.21115-4-ykaradzhov@vmware.com
Reported-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Fixes: f97e31f00 ("kernel-shark-qt: Introduce the visualization model ..")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
In ksmodel_shift_forward() and ksmodel_shift_backward() we are supposed
to recalculate only the content of the new (non-overlapping) Bins. However
the loop does not take into account that the static function used to do
the job actually calculates next Bin (bin + 1). The result is this
misunderstanding is that we recalculate also the first overlapping
Bin (n). This wipes up the effect of the bug fixed by the previous patch.
Link: http://lore.kernel.org/linux-trace-devel/20190221124205.21115-3-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Fixes: f97e31f00 ("kernel-shark-qt: Introduce the visualization model ..")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Bin 0 of the new model has to be set after copying the overlaping bins
from the old model. Otherwise the new content of Bin 0 will be copied
into Bin "n". This bug has no effect because ksmodel_shift_backward()
has a second bug in the loop over the non-overlapping bins. The second
bug will be fixed in the following patch.
Link: http://lore.kernel.org/linux-trace-devel/20190221124205.21115-2-ykaradzhov@vmware.com
Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>
Fixes: f97e31f00 ("kernel-shark-qt: Introduce the visualization model ..")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This patch removes several unused #include directives.
No changes in behaviour intended.
Link: http://lore.kernel.org/linux-trace-devel/20190214140723.27804-3-kaslevs@vmware.com
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Use SPLICE_F_ defines to refer to splice() flags instead of their numeric
values. This should be only necessary on systems with glibc version < 2.5.
No changes in behavior intended.
Link: http://lore.kernel.org/linux-trace-devel/20190214140723.27804-2-kaslevs@vmware.com
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
tracecmd_recorder is leaking brass pipe() file descriptors it creates for
splice()-ing. Fix this.
Link: http://lore.kernel.org/linux-trace-devel/20190214140723.27804-1-kaslevs@vmware.com
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When loading a new trace.dat file the OpenGL widget has to be properly
reset. One important operation of this reset is to set the "_data"
pointer to NULL. This will block all attempts for drawing something
before the widget is set again. The bug was introduced in
7d057ae56 ("kernel-shark-qt: Add Trace Graph widget")
but had no effect until
94efea960 ("kernel-shark-qt: Handle the case when the range of ...")
because the number of bins of the model was zero, so nothing was plotted
anyway.
Link: http://lore.kernel.org/linux-trace-devel/20190214140451.827-1-ykaradzhov@vmware.com
Reported-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Tested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Fixes: 7d057ae56 ("kernel-shark-qt: Add Trace Graph widget")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Now that the sched plugin only requires a single wakeup event to process the
wakeup latency boxes, there's no guarantee that all the wakeup events saved
in plugin_sched_context_handler will be initialized.
Allocate plugin_sched_context_handler to zeros with calloc() instead of
malloc() to make sure the pointers it has are NULL and not left
uninitialized.
Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Fixes: e50d3bbfc9a4 ("kernel-shark: Add sched_waking event processing to sched_waking")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Adding ‘@’ to the line that is echoing in order to suppress echoing
the line itself.
Link: http://lore.kernel.org/linux-trace-devel/20190213161216.14438-8-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Fixes warnings from:
kernel-shark/src/libkshark-configio.c
and
kernel-shark/src/libkshark-plugin.c
Link: http://lore.kernel.org/linux-trace-devel/20190213161216.14438-7-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The precision of the displayed time of the two markers is set to
1 microsecond (as in the table). In the same time the precision of
the time difference (Delta) is now 1 nanosecond, because we expect
that the user do not care that much about the absolute time of the
event, but may want to measure the interval between two events with
the highest possible precision. The displayed time is formatted
(spaces added) in a way that aims to make it easy to read the
milliseconds and the microseconds.
Link: http://lore.kernel.org/linux-trace-devel/20190213161216.14438-6-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
When plotting a task graph and no data from the Task is found in the bin,
we check the CPU, previously used by the task, searching for data from
another task running on the same CPU. However this search will always
fail if we use the Data collection of the plotted task.
Link: http://lore.kernel.org/linux-trace-devel/20190213161216.14438-5-ykaradzhov@vmware.com
Fixes: ba206aaa45 ("kernel-shark-qt: Add C++ API for drawing of Graphs")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Handle the case when task is active in the Lower Overflow bin and the
sched_switch event that close the task graph happens to be in bin 0.
Link: http://lore.kernel.org/linux-trace-devel/20190213161216.14438-4-ykaradzhov@vmware.com
Fixes: ba206aaa45 ("kernel-shark-qt: Add C++ API for drawing of Graphs")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
ksmodel_shift_forward() copies the mapping indexes of all overlapping
bins of the model starting from bin "0" of the new histo up to bin
"histo->n_bins - n". Then the mapping index of the old Upper Overflow
bin is considered to be the mapping index of first non-overlapping bin,
which is wrong. It is wrong because in ksmodel_set_upper_edge() the
value of "histo->max" is considered inside the range of the model hence
the Upper Overflow bin starts at "histo->max + 1" but the first
non-overlapping bin will start at exactly "histo->max".
Link: http://lore.kernel.org/linux-trace-devel/20190213161216.14438-3-ykaradzhov@vmware.com
Fixes: f97e31f00 ("kernel-shark-qt: Introduce the visualization model used by the Qt-based KS")
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
I found that those checks are very useful for early detection of
misbehavior (bugs) of the visualization model. In particular those
checks helped me a lot when developing the multi-stream branch of
KernelShark (future version 2.0).
Link: http://lore.kernel.org/linux-trace-devel/20190213161216.14438-2-ykaradzhov@vmware.com
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
This method deselects the Active marker regardless of its state (A or B).
The method is renamed in order to avoid confusion with the methods for
deselecting markers A and B.
Link: http://lore.kernel.org/linux-trace-devel/20190212170402.10104-6-ykaradzhov@vmware.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Methods for deselecting Marker A and B are added to KsMainWindow. Those
methods are connected to the "deselect" signals of the two marker buttons.
Link: http://lore.kernel.org/linux-trace-devel/20190212170402.10104-5-ykaradzhov@vmware.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
Currently the model of the table treats any negative value of the Passive
Marker index as "No Row is Selected". In multiple places in the code the
value of "-1" is used in order to deselecting the marker. Defining a
dedicated constant (KS_NO_ROW_SELECTED), to be used for deselecting the
Passive Marker will make the code more readable and robust.
Link: http://lore.kernel.org/linux-trace-devel/20190212170402.10104-4-ykaradzhov@vmware.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The same method can be used to deselect the Passive marker.
Link: http://lore.kernel.org/linux-trace-devel/20190212170402.10104-3-ykaradzhov@vmware.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
The handler for "mouse press events" in the customized button is
reimplemented in order to provide the emission of a "deselect"
signal in the case of right mouse click. Two additional signals are
defined in KsDualMarkerSM. Those signals are used to re-emit the
"deselect" signals of the two marker buttons. Later (in another patch)
the signals will be connected to methods where the actual deselection
of the markers will take place.
Link: http://lore.kernel.org/linux-trace-devel/20190212170402.10104-2-ykaradzhov@vmware.com
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
|
It is now more common to enable the sched_waking event than to use the
sched_wakeup or sched_wakeup_new, as it encompasses both. But the sched
plugin does not handle that. Fix that by including the sched_waking event as
an event to use for processing schedule wakeup events.
Link: http://lore.kernel.org/linux-trace-devel/20190211012154.262506802@goodmis.org
Reviewed-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|