diff mbox series

[06/12] kernel-shark: Load Last Session from command line

Message ID 20190314151012.905-7-ykaradzhov@vmware.com (mailing list archive)
State Superseded
Headers show
Series Various modifications and fixes toward KS 1.0 | expand

Commit Message

Yordan Karadzhov March 14, 2019, 3:10 p.m. UTC
./kernelshark -l  will load directly the Last Session

Signed-off-by : Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark/src/kernelshark.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Steven Rostedt March 14, 2019, 11:47 p.m. UTC | #1
On Thu, 14 Mar 2019 17:10:06 +0200
Yordan Karadzhov <ykaradzhov@vmware.com> wrote:

> ./kernelshark -l  will load directly the Last Session
> 
> Signed-off-by : Yordan Karadzhov <ykaradzhov@vmware.com>
> ---
>  kernel-shark/src/kernelshark.cpp | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel-shark/src/kernelshark.cpp b/kernel-shark/src/kernelshark.cpp
> index 2ec91de..1ec6678 100644
> --- a/kernel-shark/src/kernelshark.cpp
> +++ b/kernel-shark/src/kernelshark.cpp
> @@ -28,6 +28,7 @@ void usage(const char *prog)
>  	printf("  -p	register plugin, use plugin name, absolute or relative path\n");
>  	printf("  -u	unregister plugin, use plugin name or absolute path\n");
>  	printf("  -s	import a session\n");
> +	printf("  -l	import the last session\n");
>  }
>  
>  int main(int argc, char **argv)
> @@ -40,7 +41,7 @@ int main(int argc, char **argv)
>  	int c;
>  	bool fromSession = false;
>  
> -	while ((c = getopt(argc, argv, "hvi:p:u:s:")) != -1) {
> +	while ((c = getopt(argc, argv, "hvi:p:u:s:l")) != -1) {
>  		switch(c) {
>  		case 'h':
>  			usage(argv[0]);
> @@ -65,6 +66,12 @@ int main(int argc, char **argv)
>  		case 's':
>  			ks.loadSession(QString(optarg));
>  			fromSession = true;
> +			break;
> +
> +		case 'l':
> +			ks.loadSession(ks.lastSessionFile());
> +			fromSession = true;
> +			break;

This produces:

[ 69%] Building CXX object src/CMakeFiles/kernelshark.dir/kernelshark.cpp.o
/work/git/trace-cmd.git/kernel-shark/src/kernelshark.cpp: In function ‘int main(int, char**)’:
/work/git/trace-cmd.git/kernel-shark/src/kernelshark.cpp:72:22: error: ‘class KsMainWindow’ has no member named ‘lastSessionFile’; did you mean ‘loadSession’?
    ks.loadSession(ks.lastSessionFile());
                      ^~~~~~~~~~~~~~~
                      loadSession


Am I missing something?

-- Steve

>  
>  		default:
>  			break;
Yordan Karadzhov March 15, 2019, 6:13 a.m. UTC | #2
On 15.03.19 г. 1:47 ч., Steven Rostedt wrote:
> On Thu, 14 Mar 2019 17:10:06 +0200
> Yordan Karadzhov <ykaradzhov@vmware.com> wrote:
> 
>> ./kernelshark -l  will load directly the Last Session
>>
>> Signed-off-by : Yordan Karadzhov <ykaradzhov@vmware.com>
>> ---
>>   kernel-shark/src/kernelshark.cpp | 9 ++++++++-
>>   1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel-shark/src/kernelshark.cpp b/kernel-shark/src/kernelshark.cpp
>> index 2ec91de..1ec6678 100644
>> --- a/kernel-shark/src/kernelshark.cpp
>> +++ b/kernel-shark/src/kernelshark.cpp
>> @@ -28,6 +28,7 @@ void usage(const char *prog)
>>   	printf("  -p	register plugin, use plugin name, absolute or relative path\n");
>>   	printf("  -u	unregister plugin, use plugin name or absolute path\n");
>>   	printf("  -s	import a session\n");
>> +	printf("  -l	import the last session\n");
>>   }
>>   
>>   int main(int argc, char **argv)
>> @@ -40,7 +41,7 @@ int main(int argc, char **argv)
>>   	int c;
>>   	bool fromSession = false;
>>   
>> -	while ((c = getopt(argc, argv, "hvi:p:u:s:")) != -1) {
>> +	while ((c = getopt(argc, argv, "hvi:p:u:s:l")) != -1) {
>>   		switch(c) {
>>   		case 'h':
>>   			usage(argv[0]);
>> @@ -65,6 +66,12 @@ int main(int argc, char **argv)
>>   		case 's':
>>   			ks.loadSession(QString(optarg));
>>   			fromSession = true;
>> +			break;
>> +
>> +		case 'l':
>> +			ks.loadSession(ks.lastSessionFile());
>> +			fromSession = true;
>> +			break;
> 
> This produces:
> 
> [ 69%] Building CXX object src/CMakeFiles/kernelshark.dir/kernelshark.cpp.o
> /work/git/trace-cmd.git/kernel-shark/src/kernelshark.cpp: In function ‘int main(int, char**)’:
> /work/git/trace-cmd.git/kernel-shark/src/kernelshark.cpp:72:22: error: ‘class KsMainWindow’ has no member named ‘lastSessionFile’; did you mean ‘loadSession’?
>      ks.loadSession(ks.lastSessionFile());
>                        ^~~~~~~~~~~~~~~
>                        loadSession
> 
> 
> Am I missing something?
> 

Looks like you are missing the two previous patch sets:

[PATCH v2 0/3]  Tuning the KernelShark build system
and
[PATCH v2 0/4] Add dialog for loading user-defined plugins

Thanks!
Yordan



> -- Steve
> 
>>   
>>   		default:
>>   			break;
>
Steven Rostedt March 18, 2019, 5:44 p.m. UTC | #3
On Fri, 15 Mar 2019 08:13:10 +0200
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

> > Am I missing something?
> >   
> 
> Looks like you are missing the two previous patch sets:
> 
> [PATCH v2 0/3]  Tuning the KernelShark build system
> and
> [PATCH v2 0/4] Add dialog for loading user-defined plugins

Please make sure to mention dependencies in the 0/X patch change log.
Each patch set should be stand alone unless explicitly stated otherwise.

As when you get a lot of change series, you may go backwards in
accepting them (which is what I do).

-- Steve
diff mbox series

Patch

diff --git a/kernel-shark/src/kernelshark.cpp b/kernel-shark/src/kernelshark.cpp
index 2ec91de..1ec6678 100644
--- a/kernel-shark/src/kernelshark.cpp
+++ b/kernel-shark/src/kernelshark.cpp
@@ -28,6 +28,7 @@  void usage(const char *prog)
 	printf("  -p	register plugin, use plugin name, absolute or relative path\n");
 	printf("  -u	unregister plugin, use plugin name or absolute path\n");
 	printf("  -s	import a session\n");
+	printf("  -l	import the last session\n");
 }
 
 int main(int argc, char **argv)
@@ -40,7 +41,7 @@  int main(int argc, char **argv)
 	int c;
 	bool fromSession = false;
 
-	while ((c = getopt(argc, argv, "hvi:p:u:s:")) != -1) {
+	while ((c = getopt(argc, argv, "hvi:p:u:s:l")) != -1) {
 		switch(c) {
 		case 'h':
 			usage(argv[0]);
@@ -65,6 +66,12 @@  int main(int argc, char **argv)
 		case 's':
 			ks.loadSession(QString(optarg));
 			fromSession = true;
+			break;
+
+		case 'l':
+			ks.loadSession(ks.lastSessionFile());
+			fromSession = true;
+			break;
 
 		default:
 			break;