linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Slavomir Kaslev <kaslevs@vmware.com>
Cc: Yordan Karadzhov <ykaradzhov@vmware.com>,
	linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH 1/4] kernel-shark: Configuration information in ${HOME}/.cache/kernelshark
Date: Tue, 9 Apr 2019 15:23:56 +0300	[thread overview]
Message-ID: <0808d774-880a-f232-dda3-cd897120d86d@gmail.com> (raw)
In-Reply-To: <20190408111308.301f30c1@gandalf.local.home>



On 8.04.19 г. 18:13 ч., Steven Rostedt wrote:
> On Mon, 8 Apr 2019 18:01:03 +0300
> Slavomir Kaslev <kaslevs@vmware.com> wrote:
> 
>>> +++ b/Makefile
>>> @@ -254,7 +254,10 @@ all_cmd: $(CMD_TARGETS)
>>>   CMAKE_COMMAND = /usr/bin/cmake
>>>   
>>>   $(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt
>>> -	$(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) -D_INSTALL_PREFIX=$(prefix) ..
>>> +
>>> +	$(Q) cd $(kshark-dir)/build && $(CMAKE_COMMAND) \
>>> +		-D_KS_CACHE_DIR=$(HOME)/.cache/kernelshark \
>>                                  ^
>> Which $HOME would that be? The one for the user who built kernelshark and not the user who runs it.
>>
>>

As it is right now Cmake will get the value of the -D_KS_CACHE_DIR 
argument and will tell the GUI to save cache files there. And yes, in 
this case it will be in the $HOME of the user who built kernelshark.

I can make the GUI to check if _KS_CACHE_DIR is defined and if its value 
(path) belongs to the user who runs the GUI. If this is not the case, 
The GUI will use the default location (~/cache/kernelshark).

Is this OK?

Thanks!
Yordan



>>> +		-D_INSTALL_PREFIX=$(prefix) ..
> 
> Correct, this needs to be the HOME from the run time environment. Which
> is taken as the third parameter from main!
> 
> #include <stdio.h>
> #include <string.h>
> int main(int argc, char **argv, **envp)
> {
> 	int i;
> 	for (i = 0; env[i]; i++) {
> 		if (strncmp(env[i], "HOME=", 5) == 0)
> 			printf("home is %s\n", env[i] + 5);
> 	}
> 	return 0;
> }
> 
> 
> -- Steve
> 

  reply	other threads:[~2019-04-09 12:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 14:55 [PATCH 0/4] Various modifications and fixes toward KS 1.0 Yordan Karadzhov
2019-04-04 14:56 ` [PATCH 1/4] kernel-shark: Configuration information in ${HOME}/.cache/kernelshark Yordan Karadzhov
2019-04-08 15:01   ` Slavomir Kaslev
2019-04-08 15:13     ` Steven Rostedt
2019-04-09 12:23       ` Yordan Karadzhov (VMware) [this message]
2019-04-09 13:11         ` Slavomir Kaslev
2019-04-09 13:23         ` Steven Rostedt
2019-04-09 13:33           ` Yordan Karadzhov
2019-04-09 14:59           ` Slavomir Kaslev
2019-04-09 15:11             ` Steven Rostedt
2019-04-09 15:44               ` Slavomir Kaslev
2019-04-09 17:02                 ` Steven Rostedt
2019-04-15 11:05                 ` Yordan Karadzhov (VMware)
2019-04-15 13:11                   ` Slavomir Kaslev
2019-04-15 13:58                     ` Yordan Karadzhov (VMware)
2019-04-15 11:16                 ` Yordan Karadzhov (VMware)
2019-04-15 20:04                   ` Steven Rostedt
2019-04-04 14:56 ` [PATCH 2/4] kernel-shark: Set the configuration cache directory via env. variable Yordan Karadzhov
2019-04-04 14:56 ` [PATCH 3/4] kernel-shark: Load Last Session from command line Yordan Karadzhov
2019-04-04 14:56 ` [PATCH 4/4] kernel-shark: Configuration file directory to be created by the executable Yordan Karadzhov
2019-04-08 15:03   ` Slavomir Kaslev

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=0808d774-880a-f232-dda3-cd897120d86d@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=kaslevs@vmware.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=ykaradzhov@vmware.com \
    /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).