summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch')
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch134
1 files changed, 29 insertions, 105 deletions
diff --git a/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch b/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch
index 45cab7d3d8..20fc5e503b 100644
--- a/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch
+++ b/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch
@@ -1,7 +1,7 @@
1oprofile: Determine the root home directory dynamically 1oprofile: Determine the root home directory dynamically
2 2
3This commit detects the root home directory dynamically with changes to 3This commit detects the root home directory dynamically with changes to
4the opcontrol script and the oprofile gui app source. 4the oprofile gui app source.
5 5
6The commit replaces an earlier fix that detected and adjusted a 6The commit replaces an earlier fix that detected and adjusted a
7'non-standard' root home directory at build time. The advantage of this 7'non-standard' root home directory at build time. The advantage of this
@@ -12,109 +12,33 @@ Upstream-Status: inappropriate [OE specific]
12 12
13Signed-off-by: Dave Lerner <dave.lerner@windriver.com> 13Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
14 14
15diff --git a/doc/opcontrol.1.in b/doc/opcontrol.1.in 15Index: oprofile-1.0.0/doc/oprofile.html
16index c434704..f57eb76 100644 16===================================================================
17--- a/doc/opcontrol.1.in 17--- oprofile-1.0.0.orig/doc/oprofile.html 2014-11-03 17:55:31.511034857 +0000
18+++ b/doc/opcontrol.1.in 18+++ oprofile-1.0.0/doc/oprofile.html 2014-11-03 17:57:26.415037988 +0000
19@@ -171,7 +171,7 @@ No special environment variables are recognised by opcontrol. 19@@ -1563,8 +1563,8 @@
20 20 <span class="emphasis"><em>must</em></span> stop it in a controlled manner in order to process
21 .SH FILES 21 the profile data it has collected. Use <code class="code">kill -SIGINT &lt;operf-PID&gt;</code>
22 .TP 22 for this purpose. It is recommended that when running <span class="command"><strong>operf</strong></span>
23-.I /root/.oprofile/daemonrc 23- with this option, your current working directory should be <code class="filename">/root</code> or a subdirectory
24+.I ~root/.oprofile/daemonrc 24- of <code class="filename">/root</code> to avoid storing sample data files in locations accessible by regular users.
25 Configuration file for opcontrol 25+ with this option, your current working directory should be <code class="filename">~root</code> or a subdirectory
26 .TP 26+ of <code class="filename">~root</code> to avoid storing sample data files in locations accessible by regular users.
27 .I /var/lib/oprofile/samples/
28diff --git a/doc/oprofile.1.in b/doc/oprofile.1.in
29index 3d0f0ed..5c623e1 100644
30--- a/doc/oprofile.1.in
31+++ b/doc/oprofile.1.in
32@@ -150,7 +150,7 @@ No special environment variables are recognised by oprofile.
33 .I $HOME/.oprofile/
34 Configuration files
35 .TP
36-.I /root/.oprofile/daemonrc
37+.I ~root/.oprofile/daemonrc
38 Configuration file for opcontrol
39 .TP
40 .I @prefix@/share/oprofile/
41diff --git a/doc/oprofile.html b/doc/oprofile.html
42index 128d9f7..d7e4dea 100644
43--- a/doc/oprofile.html
44+++ b/doc/oprofile.html
45@@ -1394,7 +1394,7 @@ The <span class="command"><strong>opcontrol</strong></span> script provides the
46 <dd>
47 <p>
48 Followed by list arguments for profiling set up. List of arguments
49- saved in <code class="filename">/root/.oprofile/daemonrc</code>.
50+ saved in <code class="filename">~root/.oprofile/daemonrc</code>.
51 Giving this option is not necessary; you can just directly pass one
52 of the setup options, e.g. <span class="command"><strong>opcontrol --no-vmlinux</strong></span>.
53 </p>
54@@ -1430,7 +1430,7 @@ The <span class="command"><strong>opcontrol</strong></span> script provides the
55 <dd>
56 <p>
57 Start data collection with either arguments provided by <code class="option">--setup</code>
58- or information saved in <code class="filename">/root/.oprofile/daemonrc</code>. Specifying
59+ or information saved in <code class="filename">~root/.oprofile/daemonrc</code>. Specifying
60 the addition <code class="option">--verbose</code> makes the daemon generate lots of debug data
61 whilst it is running.
62 </p> 27 </p>
63diff --git a/doc/oprofile.xml b/doc/oprofile.xml 28 </dd>
64index 6a17c6d..0968d76 100644 29 <dt>
65--- a/doc/oprofile.xml 30Index: oprofile-1.0.0/doc/oprofile.xml
66+++ b/doc/oprofile.xml 31===================================================================
67@@ -568,7 +568,7 @@ The <command>opcontrol</command> script provides the following actions : 32--- oprofile-1.0.0.orig/doc/oprofile.xml 2014-11-03 17:55:31.515034857 +0000
68 <term><option>--setup</option></term> 33+++ oprofile-1.0.0/doc/oprofile.xml 2014-11-03 17:58:03.719039005 +0000
69 <listitem><para> 34@@ -654,8 +654,8 @@
70 Followed by list arguments for profiling set up. List of arguments 35 <emphasis>must</emphasis> stop it in a controlled manner in order to process
71- saved in <filename>/root/.oprofile/daemonrc</filename>. 36 the profile data it has collected. Use <code>kill -SIGINT &lt;operf-PID&gt;</code>
72+ saved in <filename>~root/.oprofile/daemonrc</filename>. 37 for this purpose. It is recommended that when running <command>operf</command>
73 Giving this option is not necessary; you can just directly pass one 38- with this option, your current working directory should be <filename>/root</filename> or a subdirectory
74 of the setup options, e.g. <command>opcontrol --no-vmlinux</command>. 39- of <filename>/root</filename> to avoid storing sample data files in locations accessible by regular users.
75 </para></listitem> 40+ with this option, your current working directory should be <filename>~root</filename> or a subdirectory
76@@ -592,7 +592,7 @@ The <command>opcontrol</command> script provides the following actions : 41+ of <filename>~root</filename> to avoid storing sample data files in locations accessible by regular users.
77 <term><option>--start</option></term>
78 <listitem><para>
79 Start data collection with either arguments provided by <option>--setup</option>
80- or information saved in <filename>/root/.oprofile/daemonrc</filename>. Specifying
81+ or information saved in <filename>~root/.oprofile/daemonrc</filename>. Specifying
82 the addition <option>--verbose</option> makes the daemon generate lots of debug data
83 whilst it is running.
84 </para></listitem> 42 </para></listitem>
85diff --git a/gui/oprof_start_util.cpp b/gui/oprof_start_util.cpp 43 </varlistentry>
86index d293431..d13fa8f 100644 44 <varlistentry>
87--- a/gui/oprof_start_util.cpp
88+++ b/gui/oprof_start_util.cpp
89@@ -20,6 +20,8 @@
90 #include <iostream>
91 #include <fstream>
92 #include <cstdlib>
93+#include <sys/types.h>
94+#include <pwd.h>
95
96 #include <qfiledialog.h>
97 #include <qmessagebox.h>
98@@ -39,7 +41,8 @@ namespace {
99 // return the ~ expansion suffixed with a '/'
100 string const get_config_dir()
101 {
102- return "/root";
103+ struct *pw = getpwnam("root");
104+ return pw->pw_dir;
105 }
106
107 string daemon_pid;
108diff --git a/utils/opcontrol b/utils/opcontrol
109index 09fa5a7..a8acdae 100644
110--- a/utils/opcontrol
111+++ b/utils/opcontrol
112@@ -385,7 +385,7 @@ do_init()
113 OPROFILED="$OPDIR/oprofiled"
114
115 # location for daemon setup information
116- SETUP_DIR="/root/.oprofile"
117+ SETUP_DIR="`grep root /etc/passwd | cut -d: -f6`/.oprofile"
118 SETUP_FILE="$SETUP_DIR/daemonrc"
119 SEC_SETUP_FILE="$SETUP_DIR/daemonrc_new"
120