public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] session.cxx (systemtap_session copy ctor): copy kernel_build_tree value
@ 2013-02-01 21:33 Tom Zanussi
  2013-02-02  0:54 ` Josh Stone
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Zanussi @ 2013-02-01 21:33 UTC (permalink / raw)
  To: systemtap

Hi,

Here's a patch for a problem I've seen when using systemtap to do a
'cross' invocation of a stap script on a remote target system.  I'm not
sure this is the correct fix, or if it's even proper C++, as it's been
awhile since I've done much C++, but it did fix the problem here...

When using the stap -r option with a full path to a kernel build tree
(i.e. one starting with /) along with --remote to execute the script
on a remote system, the build tree that I passed in was ignored and it
used some default locally-constructed location instead:

Checking "/lib/modules/3.4.24-yocto-standard/build/.config" failed
  with error: No such file or directory

I traced it down to the s->clone() call in the path
ssh_remote->connect()->set_child_fds(), which unconditionally invokes
the following in the systemtap_session copy constructor:

  kernel_build_tree = "/lib/modules/" + kernel_release + "/build";

That doesn't seem correct - it seems to me it should be preserving the
value from the passed-in session object, which is what this does.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 session.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/session.cxx b/session.cxx
index cccade0..1410b3f 100644
--- a/session.cxx
+++ b/session.cxx
@@ -263,7 +263,7 @@ systemtap_session::systemtap_session (const systemtap_session& other,
   last_token (0)
 {
   release = kernel_release = kern;
-  kernel_build_tree = "/lib/modules/" + kernel_release + "/build";
+  kernel_build_tree = other.kernel_build_tree;
   architecture = machine = normalize_machine(arch);
   setup_kernel_release(kern.c_str());
   native_build = false; // assumed; XXX: could be computed as in check_options()
-- 
1.7.11.4



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-05 14:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-01 21:33 [PATCH] session.cxx (systemtap_session copy ctor): copy kernel_build_tree value Tom Zanussi
2013-02-02  0:54 ` Josh Stone
2013-02-05 14:44   ` Tom Zanussi

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 read-only IMAP folder(s) and NNTP newsgroup(s).