Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/2] kernel-shark-2.alpha: Allow appending multiple datafiles from command line
@ 2020-04-03 16:02 Yordan Karadzhov (VMware)
  2020-04-03 16:02 ` [PATCH 2/2] kernel-shark-2.alpha: Show the file name in the time offset dialog Yordan Karadzhov (VMware)
  0 siblings, 1 reply; 2+ messages in thread
From: Yordan Karadzhov (VMware) @ 2020-04-03 16:02 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)

Multiple data files can be appended using the "-a" command line option.
This can be done with:

kernelshark -i foo -a bar1 -a bar2

or

kernelshark -i foo -a "bar1 bar2"

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/kernelshark.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/kernelshark.cpp b/src/kernelshark.cpp
index bb51f88..590783f 100644
--- a/src/kernelshark.cpp
+++ b/src/kernelshark.cpp
@@ -17,7 +17,8 @@
 
 #define default_input_file (char*)"trace.dat"
 
-static char *prior_input_file, *app_input_file;
+static char *prior_input_file;
+QStringList appInputFiles;
 
 void usage(const char *prog)
 {
@@ -57,7 +58,7 @@ int main(int argc, char **argv)
 			break;
 
 		case 'a':
-			app_input_file = optarg;
+			appInputFiles << QString(optarg).split(" ", QString::SkipEmptyParts);
 			break;
 
 		case 'p':
@@ -99,8 +100,8 @@ int main(int argc, char **argv)
 		if (prior_input_file)
 			ks.loadDataFile(QString(prior_input_file));
 
-		if (app_input_file)
-			ks.appendDataFile(QString(app_input_file));
+		for (auto const &f: appInputFiles)
+			ks.appendDataFile(f);
 	}
 
 	ks.show();
-- 
2.20.1


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

* [PATCH 2/2] kernel-shark-2.alpha: Show the file name in the time offset dialog
  2020-04-03 16:02 [PATCH 1/2] kernel-shark-2.alpha: Allow appending multiple datafiles from command line Yordan Karadzhov (VMware)
@ 2020-04-03 16:02 ` Yordan Karadzhov (VMware)
  0 siblings, 0 replies; 2+ messages in thread
From: Yordan Karadzhov (VMware) @ 2020-04-03 16:02 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)

This is useful when appending multiple files from the command line.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/KsMainWindow.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/KsMainWindow.cpp b/src/KsMainWindow.cpp
index af8afb3..80a6537 100644
--- a/src/KsMainWindow.cpp
+++ b/src/KsMainWindow.cpp
@@ -1255,8 +1255,10 @@ void KsMainWindow::_load(const QString& fileName, bool append)
 
 	if (append) {
 		bool ok;
+		QString description = fileName + "\n\nOffset [usec]:";
+
 		shift = QInputDialog::getDouble(this, tr("Append Trace file"),
-						      tr("Offset [usec]:"), 0,
+						      description, 0,
 						      INT_MIN, INT_MAX, 1, &ok);
 		if (ok)
 			shift *= 1000.;
-- 
2.20.1


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03 16:02 [PATCH 1/2] kernel-shark-2.alpha: Allow appending multiple datafiles from command line Yordan Karadzhov (VMware)
2020-04-03 16:02 ` [PATCH 2/2] kernel-shark-2.alpha: Show the file name in the time offset dialog 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
	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.git