Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/4] Fixes needed for KS 1.1
@ 2019-09-20 10:48 Yordan Karadzhov (VMware)
  2019-09-20 10:48 ` [PATCH 1/4] kernel-shark: Use correct order when linking all depenancies Yordan Karadzhov (VMware)
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2019-09-20 10:48 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)


Yordan Karadzhov (VMware) (4):
  kernel-shark: Use correct order when linking all depenancies
  trace-cmd: Correct the install paths of traceevent and trace-cmd
    libraries
  kernel-shark: Fix the file paths used by Doxygen
  kernel-shark: Cleanup in KsCaptureDialog

 Makefile                                      |  8 +++----
 kernel-shark/Documentation/doxygen/dox_config |  4 ++--
 kernel-shark/src/CMakeLists.txt               | 16 +++++++-------
 kernel-shark/src/KsCaptureDialog.cpp          | 21 ++++++++++---------
 kernel-shark/src/KsCaptureDialog.hpp          |  2 --
 5 files changed, 25 insertions(+), 26 deletions(-)

-- 
2.20.1


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

* [PATCH 1/4] kernel-shark: Use correct order when linking all depenancies
  2019-09-20 10:48 [PATCH 0/4] Fixes needed for KS 1.1 Yordan Karadzhov (VMware)
@ 2019-09-20 10:48 ` Yordan Karadzhov (VMware)
  2019-09-20 10:48 ` [PATCH 2/4] trace-cmd: Correct the install paths of traceevent and trace-cmd libraries Yordan Karadzhov (VMware)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2019-09-20 10:48 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)

I wasn't aware of the importance of the order in which the libraries are
passed to the linker, so in the dependency list in src/CMakeLists.txt
I naively started with the most basic libraries first. This is WRONG.
The linker searches and resolves symbols in the order that they appear.
If library A contains a call to a function from library B, we have to
put A before B, otherwise the linker won't know that something in B
needs to be resolved.

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

diff --git a/kernel-shark/src/CMakeLists.txt b/kernel-shark/src/CMakeLists.txt
index 21494cc..e20a030 100644
--- a/kernel-shark/src/CMakeLists.txt
+++ b/kernel-shark/src/CMakeLists.txt
@@ -7,10 +7,10 @@ add_library(kshark SHARED libkshark.c
                           libkshark-configio.c
                           libkshark-collection.c)
 
-target_link_libraries(kshark ${CMAKE_DL_LIBS}
+target_link_libraries(kshark ${TRACEEVENT_LIBRARY}
+                             ${TRACECMD_LIBRARY}
                              ${JSONC_LIBRARY}
-                             ${TRACEEVENT_LIBRARY}
-                             ${TRACECMD_LIBRARY})
+                             ${CMAKE_DL_LIBS})
 
 set_target_properties(kshark  PROPERTIES SUFFIX	".so.${KS_VERSION_STRING}")
 
@@ -23,8 +23,8 @@ if (OPENGL_FOUND AND GLUT_FOUND)
                                      KsPlotTools.cpp)
 
     target_link_libraries(kshark-plot  kshark
-                                       ${OPENGL_LIBRARIES}
-                                       ${GLUT_LIBRARY})
+                                       ${GLUT_LIBRARY}
+                                       ${OPENGL_LIBRARIES})
 
     set_target_properties(kshark-plot PROPERTIES  SUFFIX ".so.${KS_VERSION_STRING}")
 
@@ -65,11 +65,11 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND)
                                                             KsAdvFilteringDialog.cpp)
 
     target_link_libraries(kshark-gui kshark-plot
-                                     ${CMAKE_DL_LIBS}
+                                     Qt5::Widgets
+                                     Qt5::Network
                                      ${TRACEEVENT_LIBRARY}
                                      ${TRACECMD_LIBRARY}
-                                     Qt5::Widgets
-                                     Qt5::Network)
+                                     ${CMAKE_DL_LIBS})
 
     set_target_properties(kshark-gui PROPERTIES  SUFFIX ".so.${KS_VERSION_STRING}")
 
-- 
2.20.1


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

* [PATCH 2/4] trace-cmd: Correct the install paths of traceevent and trace-cmd libraries
  2019-09-20 10:48 [PATCH 0/4] Fixes needed for KS 1.1 Yordan Karadzhov (VMware)
  2019-09-20 10:48 ` [PATCH 1/4] kernel-shark: Use correct order when linking all depenancies Yordan Karadzhov (VMware)
@ 2019-09-20 10:48 ` Yordan Karadzhov (VMware)
  2019-09-20 12:00   ` Yordan Karadzhov (VMware)
  2019-09-20 10:48 ` [PATCH 3/4] kernel-shark: Fix the file paths used by Doxygen Yordan Karadzhov (VMware)
  2019-09-20 10:48 ` [PATCH 4/4] kernel-shark: Cleanup in KsCaptureDialog Yordan Karadzhov (VMware)
  3 siblings, 1 reply; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2019-09-20 10:48 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)

In order to be able to use the installed versions of the library's headers
(and the libraries itself) the directories structure of the source has to
be reprodused in the install location.

This modification is needed by the NumPy interface of KernelShark.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index dabdf8d..7124b2f 100644
--- a/Makefile
+++ b/Makefile
@@ -344,12 +344,12 @@ install_gui: install_cmd gui
 	$(Q)$(MAKE) $(S) -C $(kshark-dir)/build install
 
 install_libs: libs
-	$(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ))
-	$(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ))
+	$(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ)/trace-cmd)
+	$(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ)/traceevent)
 	$(Q)$(call do_install,$(src)/include/traceevent/event-parse.h,$(includedir_SQ)/traceevent)
 	$(Q)$(call do_install,$(src)/include/traceevent/trace-seq.h,$(includedir_SQ)/traceevent)
-	$(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ))
-	$(Q)$(call do_install,$(src)/include/trace-cmd/trace-filter-hash.h,$(includedir_SQ))
+	$(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ)/trace-cmd)
+	$(Q)$(call do_install,$(src)/include/trace-cmd/trace-filter-hash.h,$(includedir_SQ)/trace-cmd)
 
 doc:
 	$(MAKE) -C $(src)/Documentation all
-- 
2.20.1


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

* [PATCH 3/4] kernel-shark: Fix the file paths used by Doxygen
  2019-09-20 10:48 [PATCH 0/4] Fixes needed for KS 1.1 Yordan Karadzhov (VMware)
  2019-09-20 10:48 ` [PATCH 1/4] kernel-shark: Use correct order when linking all depenancies Yordan Karadzhov (VMware)
  2019-09-20 10:48 ` [PATCH 2/4] trace-cmd: Correct the install paths of traceevent and trace-cmd libraries Yordan Karadzhov (VMware)
@ 2019-09-20 10:48 ` Yordan Karadzhov (VMware)
  2019-09-20 10:48 ` [PATCH 4/4] kernel-shark: Cleanup in KsCaptureDialog Yordan Karadzhov (VMware)
  3 siblings, 0 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2019-09-20 10:48 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)

The Doxygen documentation, including its configuration file, have been
moved to another directory. Therefore the paths, used by Doxygen to find
its input, have to be changed accordingly.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
Fixes: d4d68c9 (kernel-shark: Separate trace-cmd and kernelshark)
---
 kernel-shark/Documentation/doxygen/dox_config | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel-shark/Documentation/doxygen/dox_config b/kernel-shark/Documentation/doxygen/dox_config
index 43c7f84..89b9284 100644
--- a/kernel-shark/Documentation/doxygen/dox_config
+++ b/kernel-shark/Documentation/doxygen/dox_config
@@ -4,7 +4,7 @@
 DOXYFILE_ENCODING      = UTF-8
 PROJECT_NAME           = "KernelShark"
 PROJECT_BRIEF = "Kernel Shark is a front-end reader of the Linux kernel tracing data."
-INPUT                  = ../src/ ../src/plugins/
+INPUT                  = ../../src/ ../../src/plugins/
 SOURCE_BROWSER         = YES
 QT_AUTOBRIEF           = YES
 TAB_SIZE               = 8
@@ -13,4 +13,4 @@ CASE_SENSE_NAMES       = YES
 SORT_MEMBER_DOCS       = NO
 STRICT_PROTO_MATCHING  = YES
 DOT_MULTI_TARGETS      = YES
-PROJECT_LOGO           = ../icons/KS_logo_stacked.svg
+PROJECT_LOGO           = ../../icons/KS_logo_stacked.svg
-- 
2.20.1


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

* [PATCH 4/4] kernel-shark: Cleanup in KsCaptureDialog
  2019-09-20 10:48 [PATCH 0/4] Fixes needed for KS 1.1 Yordan Karadzhov (VMware)
                   ` (2 preceding siblings ...)
  2019-09-20 10:48 ` [PATCH 3/4] kernel-shark: Fix the file paths used by Doxygen Yordan Karadzhov (VMware)
@ 2019-09-20 10:48 ` Yordan Karadzhov (VMware)
  3 siblings, 0 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2019-09-20 10:48 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)

My original intend was to fix a Doxygen warning complaining about a data
member of a class not being documented. However, when I tried to write
explanation for this data member (KsCaptureMonitor::_captureStatus),
I realized that it is completely useless and that it actually violates
the encapsulation principle, since it holds the return status of the
capture process, but the capture process itself is owned by another
class (KsCaptureDialog).

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/KsCaptureDialog.cpp | 21 +++++++++++----------
 kernel-shark/src/KsCaptureDialog.hpp |  2 --
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/kernel-shark/src/KsCaptureDialog.cpp b/kernel-shark/src/KsCaptureDialog.cpp
index fff42aa..ad05917 100644
--- a/kernel-shark/src/KsCaptureDialog.cpp
+++ b/kernel-shark/src/KsCaptureDialog.cpp
@@ -385,7 +385,6 @@ KsCaptureMonitor::KsCaptureMonitor(QWidget *parent)
 : QWidget(parent),
   _mergedChannels(false),
   _argsModified(false),
-  _captureStatus(false),
   _panel(this),
   _name("Output display", this),
   _space("max size ", this),
@@ -523,9 +522,6 @@ void KsCaptureMonitor::_captureFinished(int exit, QProcess::ExitStatus status)
 		_consolOutput.appendPlainText(errMessage);
 
 		QCoreApplication::processEvents();
-		_captureStatus = false;
-	} else {
-		_captureStatus = true;
 	}
 }
 
@@ -585,6 +581,17 @@ void KsCaptureDialog::_capture()
 	_captureProc.start();
 	_captureProc.waitForFinished();
 
+	/* Reset the _argsModified flag. */
+	_captureMon._argsModified = false;
+
+	if (_captureProc.exitCode() != 0 ||
+	    _captureProc.exitStatus() != QProcess::NormalExit)
+		return;
+
+	/*
+	 * Capture finished successfully. Open the produced tracing data file
+	 * in KernelShark.
+	 */
 	argc = argv.count();
 	for (int i = 0; i < argc; ++i) {
 		if (argv[i] == "-o") {
@@ -592,9 +599,6 @@ void KsCaptureDialog::_capture()
 			break;
 		}
 	}
-
-	/* Reset the _argsModified flag. */
-	_captureMon._argsModified = false;
 }
 
 void KsCaptureDialog::_setChannelMode(int state)
@@ -610,9 +614,6 @@ void KsCaptureDialog::_sendOpenReq(const QString &fileName)
 {
 	QLocalSocket *socket;
 
-	if (!_captureMon._captureStatus)
-		return;
-
 	socket = new QLocalSocket(this);
 	socket->connectToServer("KSCapture", QIODevice::WriteOnly);
 	if (socket->waitForConnected()) {
diff --git a/kernel-shark/src/KsCaptureDialog.hpp b/kernel-shark/src/KsCaptureDialog.hpp
index 612080c..3fd3d8d 100644
--- a/kernel-shark/src/KsCaptureDialog.hpp
+++ b/kernel-shark/src/KsCaptureDialog.hpp
@@ -141,8 +141,6 @@ public:
 	 */
 	bool		_argsModified;
 
-	bool		_captureStatus;
-
 private:
 	QVBoxLayout	_layout;
 
-- 
2.20.1


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

* Re: [PATCH 2/4] trace-cmd: Correct the install paths of traceevent and trace-cmd libraries
  2019-09-20 10:48 ` [PATCH 2/4] trace-cmd: Correct the install paths of traceevent and trace-cmd libraries Yordan Karadzhov (VMware)
@ 2019-09-20 12:00   ` Yordan Karadzhov (VMware)
  0 siblings, 0 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2019-09-20 12:00 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

This one is wrong. Please ignore it.
I am sending v2.

Thanks!
Yordan

On 20.09.19 г. 13:48 ч., Yordan Karadzhov (VMware) wrote:
> In order to be able to use the installed versions of the library's headers
> (and the libraries itself) the directories structure of the source has to
> be reprodused in the install location.
> 
> This modification is needed by the NumPy interface of KernelShark.
> 
> Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
> ---
>   Makefile | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index dabdf8d..7124b2f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -344,12 +344,12 @@ install_gui: install_cmd gui
>   	$(Q)$(MAKE) $(S) -C $(kshark-dir)/build install
>   
>   install_libs: libs
> -	$(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ))
> -	$(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ))
> +	$(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ)/trace-cmd)
> +	$(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ)/traceevent)
>   	$(Q)$(call do_install,$(src)/include/traceevent/event-parse.h,$(includedir_SQ)/traceevent)
>   	$(Q)$(call do_install,$(src)/include/traceevent/trace-seq.h,$(includedir_SQ)/traceevent)
> -	$(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ))
> -	$(Q)$(call do_install,$(src)/include/trace-cmd/trace-filter-hash.h,$(includedir_SQ))
> +	$(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ)/trace-cmd)
> +	$(Q)$(call do_install,$(src)/include/trace-cmd/trace-filter-hash.h,$(includedir_SQ)/trace-cmd)
>   
>   doc:
>   	$(MAKE) -C $(src)/Documentation all
> 

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

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 10:48 [PATCH 0/4] Fixes needed for KS 1.1 Yordan Karadzhov (VMware)
2019-09-20 10:48 ` [PATCH 1/4] kernel-shark: Use correct order when linking all depenancies Yordan Karadzhov (VMware)
2019-09-20 10:48 ` [PATCH 2/4] trace-cmd: Correct the install paths of traceevent and trace-cmd libraries Yordan Karadzhov (VMware)
2019-09-20 12:00   ` Yordan Karadzhov (VMware)
2019-09-20 10:48 ` [PATCH 3/4] kernel-shark: Fix the file paths used by Doxygen Yordan Karadzhov (VMware)
2019-09-20 10:48 ` [PATCH 4/4] kernel-shark: Cleanup in KsCaptureDialog Yordan Karadzhov (VMware)

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org linux-trace-devel@archiver.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox