Re: [PATCH 1/4] kernel-shark: Configuration information in ${HOME}/.cache/kernelshark

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 8.04.19 г. 18:13 ч., Steven Rostedt wrote:
On Mon, 8 Apr 2019 18:01:03 +0300
Slavomir Kaslev <kaslevs@xxxxxxxxxx> 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




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux