* [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 related [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 related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-03 16:02 UTC | newest]
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)
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).