linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
	"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH 1/2] kernel-shark-2.alpha: Allow appending multiple datafiles from command line
Date: Fri,  3 Apr 2020 19:02:29 +0300	[thread overview]
Message-ID: <20200403160230.11185-1-y.karadz@gmail.com> (raw)

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


             reply	other threads:[~2020-04-03 16:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 16:02 Yordan Karadzhov (VMware) [this message]
2020-04-03 16:02 ` [PATCH 2/2] kernel-shark-2.alpha: Show the file name in the time offset dialog Yordan Karadzhov (VMware)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200403160230.11185-1-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).