From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9058 invoked by alias); 1 Feb 2013 21:33:06 -0000 Received: (qmail 9044 invoked by uid 22791); 1 Feb 2013 21:33:04 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Feb 2013 21:32:59 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 01 Feb 2013 13:32:58 -0800 X-ExtLoop1: 1 Received: from unknown (HELO [10.255.12.85]) ([10.255.12.85]) by fmsmga001.fm.intel.com with ESMTP; 01 Feb 2013 13:32:58 -0800 Message-ID: <1359754377.5658.28.camel@empanada> Subject: [PATCH] session.cxx (systemtap_session copy ctor): copy kernel_build_tree value From: Tom Zanussi To: systemtap@sourceware.org Date: Fri, 01 Feb 2013 21:33:00 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2013-q1/txt/msg00078.txt.bz2 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 --- 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