linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Various minor modifications and fixes toward KS 2.0
@ 2021-04-21 14:51 Yordan Karadzhov (VMware)
  2021-04-21 14:51 ` [PATCH 1/4] kernel-shark: Fix warnings from deprecated Qt APIs Yordan Karadzhov (VMware)
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2021-04-21 14:51 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Yordan Karadzhov (VMware)

Yordan Karadzhov (VMware) (4):
  kernel-shark: Fix warnings from deprecated Qt APIs
  kernel-shark: Polish the README file
  kernel-shark: Exclude libkshark-plot from libkshark-devel
  kernel-shark: Integrate install_libkshark-devel.sh

 README                           | 42 ++++++++++++++++++++------------
 build/install_libkshark-devel.sh |  6 ++++-
 src/CMakeLists.txt               | 13 ++--------
 src/KsTraceGraph.cpp             |  9 +++++--
 src/KsWidgetsLib.cpp             | 14 +++++------
 5 files changed, 48 insertions(+), 36 deletions(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] kernel-shark: Fix warnings from deprecated Qt APIs
  2021-04-21 14:51 [PATCH 0/4] Various minor modifications and fixes toward KS 2.0 Yordan Karadzhov (VMware)
@ 2021-04-21 14:51 ` Yordan Karadzhov (VMware)
  2021-04-21 14:51 ` [PATCH 2/4] kernel-shark: Polish the README file Yordan Karadzhov (VMware)
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2021-04-21 14:51 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Yordan Karadzhov (VMware)

Couple of APIs used by KernelShark have been marked as deprecated
in the recent version of Qt. Fix all compilation warnings caused
by the usage of these deprecated APIs.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/KsTraceGraph.cpp |  9 +++++++--
 src/KsWidgetsLib.cpp | 14 +++++++-------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/KsTraceGraph.cpp b/src/KsTraceGraph.cpp
index fd9cfac..1e976df 100644
--- a/src/KsTraceGraph.cpp
+++ b/src/KsTraceGraph.cpp
@@ -327,13 +327,18 @@ void KsTraceGraph::_setPointerInfo(size_t i)
 	QString aux(lanMakeString(kshark_get_aux_info(e)));
 	QString info(lanMakeString(kshark_get_info(e)));
 	QString comm(lanMakeString(kshark_get_task(e)));
-	QString pointer, elidedText;
+	QString elidedText;
 	int labelWidth;
 	uint64_t sec, usec;
+	char *pointer;
 
 	kshark_convert_nano(e->ts, &sec, &usec);
-	pointer.sprintf("%" PRIu64 ".%06" PRIu64 "", sec, usec);
+	labelWidth = asprintf(&pointer, "%" PRIu64 ".%06" PRIu64 "", sec, usec);
+	if (labelWidth <= 0)
+		return;
+
 	_labelP2.setText(pointer);
+	free(pointer);
 
 	comm.append("-");
 	comm.append(QString("%1").arg(kshark_get_pid(e)));
diff --git a/src/KsWidgetsLib.cpp b/src/KsWidgetsLib.cpp
index 4ec6033..e30bf27 100644
--- a/src/KsWidgetsLib.cpp
+++ b/src/KsWidgetsLib.cpp
@@ -926,9 +926,9 @@ KsCPUCheckBoxWidget::KsCPUCheckBoxWidget(kshark_data_stream *stream, QWidget *pa
 		cpuItem->setText(0, "  ");
 		cpuItem->setText(1, QString("CPU %1").arg(i));
 		cpuItem->setCheckState(0, Qt::Checked);
-		cpuItem->setBackgroundColor(0, QColor(colors[i].r(),
-						      colors[i].g(),
-						      colors[i].b()));
+		cpuItem->setBackground(0, QColor(colors[i].r(),
+						 colors[i].g(),
+						 colors[i].b()));
 		_tree.addTopLevelItem(cpuItem);
 		_id[i] = i;
 		_cb[i] = cpuItem;
@@ -1115,12 +1115,12 @@ KsTasksCheckBoxWidget::KsTasksCheckBoxWidget(kshark_data_stream *stream,
 
 		comItem = new QTableWidgetItem(tr(comm));
 
-		pidItem->setBackgroundColor(QColor(colors[pid].r(),
-						   colors[pid].g(),
-						   colors[pid].b()));
+		pidItem->setBackground(QColor(colors[pid].r(),
+					      colors[pid].g(),
+					      colors[pid].b()));
 
 		if (_id[i] == 0)
-			pidItem->setTextColor(Qt::white);
+			pidItem->setForeground(Qt::white);
 
 		_table.setItem(i, 2, comItem);
 	}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] kernel-shark: Polish the README file
  2021-04-21 14:51 [PATCH 0/4] Various minor modifications and fixes toward KS 2.0 Yordan Karadzhov (VMware)
  2021-04-21 14:51 ` [PATCH 1/4] kernel-shark: Fix warnings from deprecated Qt APIs Yordan Karadzhov (VMware)
@ 2021-04-21 14:51 ` Yordan Karadzhov (VMware)
  2021-04-21 14:51 ` [PATCH 3/4] kernel-shark: Exclude libkshark-plot from libkshark-devel Yordan Karadzhov (VMware)
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2021-04-21 14:51 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Yordan Karadzhov (VMware)

Fixing some typos and making it easier to read.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 README | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/README b/README
index f5035f9..b1934c3 100644
--- a/README
+++ b/README
@@ -7,7 +7,8 @@ The official repository is here:
 Third Party Software:
 ------------------------------------------------------------
 KernelShark has the following external dependencies:
-  Cmake, Json-C, OpenGL/Glut, Qt5Base, libtraceevent, libtracefs, trace-cmd.
+  Cmake, Json-C, OpenGL/Glut, Qt5Base, libtraceevent, libtracefs, trace-cmd
+  and FreeSans font.
 
 1. In order to install the packages on Ubuntu do the following:
     sudo apt-get install build-essential git cmake libjson-c-dev -y
@@ -15,7 +16,7 @@ KernelShark has the following external dependencies:
     sudo apt-get install fonts-freefont-ttf
     sudo apt-get install qtbase5-dev -y
 
-1.1 I you want to be able to generate Doxygen documentation:
+1.1 If you want to be able to generate Doxygen documentation:
     sudo apt-get install graphviz doxygen-gui -y
 
 
@@ -24,7 +25,7 @@ KernelShark has the following external dependencies:
     dnf install freeglut-devel redhat-rpm-config -y
     dnf install qt5-qtbase-devel -y
 
-2.1 I you want to be able to generate Doxygen documentation:
+2.1 If you want to be able to generate Doxygen documentation:
     dnf install graphviz doxygen -y
 
 
@@ -46,26 +47,27 @@ KernelShark has the following external dependencies:
 
 Building:
 ------------------------------------------------------------
-2. Building KernelShark:
+1. Building and install KernelShark GUI:
 
     cd kernel-shark/build
     cmake ../
     make
     sudo ./install_gui.sh
 
-2.1 In order to create a Doxygen documentation add -D_DOXYGEN_DOC=1
-as a CMake Command-Line option.
+1.1 In order to create a Doxygen documentation add -D_DOXYGEN_DOC=1
+as a CMake Command-Line option (see the example below).
 
-2.2 KernelShark has multiple build types. By default, the build type is
+1.2 KernelShark has multiple build types. By default, the build type is
 RelWithDebInfo, which will build a release candidate with debug information.
-To change the type, pass in the option CMAKE_BUILD_TYPE=<type>.
+To change the type, pass in the option CMAKE_BUILD_TYPE=<type> (see the
+example below).
 
     cmake -DCMAKE_BUILD_TYPE=Debug           - for "-g" option
     cmake -DCMAKE_BUILD_TYPE=Release         - for "-O3" option
     cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo  - for "-g -O2" option (default)
     cmake -DCMAKE_BUILD_TYPE=MinSizeRel      - for "-Os" option
 
-2.3 In addition to the standard CMake build types (Debug, Release,
+1.3 In addition to the standard CMake build types (Debug, Release,
 RelWithDebInfo, MinSizeRel) KernelShark supports a "Package" build type.
 By default this build type adds the "-O3" compiler flag. Package maintainers
 can chose their own compiler flags by providing the corresponding
@@ -74,19 +76,19 @@ CMAKE_XXXX_FLAGS_PACKAGE Command-Line options (see the example below).
 -- Note that when built as a "Package" the RPATH-s of the executables are
 set directly to _INSTALL_PREFIX/lib/kernelshark/
 
-2.4 After building the code "kernel-shark/lib" will contain all libraries
+1.4 After building the code "kernel-shark/lib" will contain all libraries
 and "kernel-shark/bin" will contain all executables.
 
-2.5 Use the script "cmake_clean.sh" if you want to delete all already
+1.5 Use the script "cmake_clean.sh" if you want to delete all already
 compiled objects and all files generated by CMake.
 
     cd kernel-shark/build
-    ./cmake-clean.sh
+    ./cmake_clean.sh
 
-2.6 By default, installation prefix is "/usr/local". It can be changed using
--D_INSTALL_PREFIX= as a CMake Command-Line option.
+1.6 By default, installation prefix is "/usr/local". It can be changed using
+-D_INSTALL_PREFIX= as a CMake Command-Line option (see the example below).
 
-2.7 In order to uninstall KernelShark do:
+1.7 In order to uninstall KernelShark do:
     cd kernel-shark/build
     ./cmake_uninstall.sh
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] kernel-shark: Exclude libkshark-plot from libkshark-devel
  2021-04-21 14:51 [PATCH 0/4] Various minor modifications and fixes toward KS 2.0 Yordan Karadzhov (VMware)
  2021-04-21 14:51 ` [PATCH 1/4] kernel-shark: Fix warnings from deprecated Qt APIs Yordan Karadzhov (VMware)
  2021-04-21 14:51 ` [PATCH 2/4] kernel-shark: Polish the README file Yordan Karadzhov (VMware)
@ 2021-04-21 14:51 ` Yordan Karadzhov (VMware)
  2021-04-21 14:51 ` [PATCH 4/4] kernel-shark: Integrate install_libkshark-devel.sh Yordan Karadzhov (VMware)
  2021-04-21 15:01 ` [PATCH 0/4] Various minor modifications and fixes toward KS 2.0 Steven Rostedt
  4 siblings, 0 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2021-04-21 14:51 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Yordan Karadzhov (VMware)

The library that provides the OpenGL plotting instruments, used by
the KernelShark GUI is remove from the "libkshark-devel" installation
component. In fact this library was never a true (functional) part
of "libkshark-devel", since its header files were never installed.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/CMakeLists.txt | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4ab0af2..f3c4e0a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,7 +21,6 @@ set_target_properties(kshark  PROPERTIES
                                   SOVERSION ${KS_VERSION_MAJOR}
                                   VERSION   ${KS_VERSION_STRING})
 
-
 install(TARGETS kshark
         LIBRARY DESTINATION    ${_LIBDIR}
             COMPONENT              kernelshark
@@ -58,18 +57,10 @@ if (OPENGL_FOUND)
                                        ${GLUT_LIBRARY}
                                        ${OPENGL_LIBRARIES})
 
-    set_target_properties(kshark-plot PROPERTIES
-                                          SOVERSION ${KS_VERSION_MAJOR}
-                                          VERSION   ${KS_VERSION_STRING})
-
+    set_target_properties(kshark-plot PROPERTIES  SUFFIX ".so.${KS_VERSION_STRING}")
     install(TARGETS kshark-plot
             LIBRARY DESTINATION    ${_LIBDIR}
-                COMPONENT              kernelshark
-                NAMELINK_COMPONENT     libkshark-devel
-            INCLUDES DESTINATION   ${_INSTALL_PREFIX}/include/${KS_APP_NAME}
-                COMPONENT              libkshark-devel
-            ARCHIVE DESTINATION    ${_LIBDIR}
-                COMPONENT              libkshark-devel)
+                COMPONENT              kernelshark)
 
 endif (OPENGL_FOUND)
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] kernel-shark: Integrate install_libkshark-devel.sh
  2021-04-21 14:51 [PATCH 0/4] Various minor modifications and fixes toward KS 2.0 Yordan Karadzhov (VMware)
                   ` (2 preceding siblings ...)
  2021-04-21 14:51 ` [PATCH 3/4] kernel-shark: Exclude libkshark-plot from libkshark-devel Yordan Karadzhov (VMware)
@ 2021-04-21 14:51 ` Yordan Karadzhov (VMware)
  2021-04-21 15:01 ` [PATCH 0/4] Various minor modifications and fixes toward KS 2.0 Steven Rostedt
  4 siblings, 0 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2021-04-21 14:51 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Yordan Karadzhov (VMware)

So far "install_libkshark-devel.sh" was an unofficial script that
was used to help installing the "libkshark-devel" component. It was
introduced, because the CMake syntax for doing this is quite hard to
memorize. Here we make this script an integrated part of the build
system. The message output is made consistent with the messages
printed by "install_gui.sh". The usage of the script is explained
in README.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 README                           | 12 +++++++++++-
 build/install_libkshark-devel.sh |  6 +++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/README b/README
index b1934c3..652891c 100644
--- a/README
+++ b/README
@@ -88,7 +88,17 @@ compiled objects and all files generated by CMake.
 1.6 By default, installation prefix is "/usr/local". It can be changed using
 -D_INSTALL_PREFIX= as a CMake Command-Line option (see the example below).
 
-1.7 In order to uninstall KernelShark do:
+2. To install libkshark-devel do:
+    sudo ./install_libkshark-devel.sh
+
+    This will install all components needed in order to use "libkshark".
+    Note that if you just use:
+
+    sudo make install
+
+    this will install both the GUI and libkshark-devel.
+
+3.  In order to uninstall KernelShark (no matter what has been installed) do:
     cd kernel-shark/build
     ./cmake_uninstall.sh
 
diff --git a/build/install_libkshark-devel.sh b/build/install_libkshark-devel.sh
index a7e420d..b20fca0 100755
--- a/build/install_libkshark-devel.sh
+++ b/build/install_libkshark-devel.sh
@@ -1 +1,5 @@
-sudo cmake -DCOMPONENT=libkshark-devel -P cmake_install.cmake
+if cmake -DCOMPONENT=libkshark-devel -P cmake_install.cmake; then
+    echo "libkshark-devel installed correctly"
+else
+        exit 1
+fi
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] Various minor modifications and fixes toward KS 2.0
  2021-04-21 14:51 [PATCH 0/4] Various minor modifications and fixes toward KS 2.0 Yordan Karadzhov (VMware)
                   ` (3 preceding siblings ...)
  2021-04-21 14:51 ` [PATCH 4/4] kernel-shark: Integrate install_libkshark-devel.sh Yordan Karadzhov (VMware)
@ 2021-04-21 15:01 ` Steven Rostedt
  4 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2021-04-21 15:01 UTC (permalink / raw)
  To: Yordan Karadzhov (VMware); +Cc: linux-trace-devel

On Wed, 21 Apr 2021 17:51:36 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

> Yordan Karadzhov (VMware) (4):
>   kernel-shark: Fix warnings from deprecated Qt APIs
>   kernel-shark: Polish the README file
>   kernel-shark: Exclude libkshark-plot from libkshark-devel
>   kernel-shark: Integrate install_libkshark-devel.sh
> 
>  README                           | 42 ++++++++++++++++++++------------
>  build/install_libkshark-devel.sh |  6 ++++-
>  src/CMakeLists.txt               | 13 ++--------
>  src/KsTraceGraph.cpp             |  9 +++++--
>  src/KsWidgetsLib.cpp             | 14 +++++------
>  5 files changed, 48 insertions(+), 36 deletions(-)
> 

All look reasonable to me.

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Thanks Yordan!

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-21 15:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 14:51 [PATCH 0/4] Various minor modifications and fixes toward KS 2.0 Yordan Karadzhov (VMware)
2021-04-21 14:51 ` [PATCH 1/4] kernel-shark: Fix warnings from deprecated Qt APIs Yordan Karadzhov (VMware)
2021-04-21 14:51 ` [PATCH 2/4] kernel-shark: Polish the README file Yordan Karadzhov (VMware)
2021-04-21 14:51 ` [PATCH 3/4] kernel-shark: Exclude libkshark-plot from libkshark-devel Yordan Karadzhov (VMware)
2021-04-21 14:51 ` [PATCH 4/4] kernel-shark: Integrate install_libkshark-devel.sh Yordan Karadzhov (VMware)
2021-04-21 15:01 ` [PATCH 0/4] Various minor modifications and fixes toward KS 2.0 Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).