From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8584 invoked by alias); 15 Dec 2009 13:50:31 -0000 Received: (qmail 8569 invoked by uid 22791); 15 Dec 2009 13:50:30 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp2.tu-cottbus.de (HELO smtp2.tu-cottbus.de) (141.43.99.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Dec 2009 13:50:25 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.tu-cottbus.de (Postfix) with ESMTP id 2CE36690154; Tue, 15 Dec 2009 14:50:23 +0100 (CET) Received: from loki (cd1.cd.tu-cottbus.de [141.43.159.77]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: meshciev) by smtp2.tu-cottbus.de (Postfix) with ESMTPSA id 64F0F69017E; Tue, 15 Dec 2009 14:50:18 +0100 (CET) Received: by loki (Postfix, from userid 1000) id D616FEAA127; Tue, 15 Dec 2009 14:50:17 +0100 (CET) Date: Tue, 15 Dec 2009 13:50:00 -0000 From: Eugeniy Meshcheryakov To: Indraneel Mukherjee Cc: systemtap@sources.redhat.com Subject: Re: systemtap-1.0.0 runtime failure on ARM - simple stap script translation fails Message-ID: <20091215135017.GA17553@localhost.localdomain> References: <48e37220912132155j7989f649r5cf719f49eb75ac6@mail.gmail.com> <20091214070934.GA5456@localhost.localdomain> <20091214071224.GA5518@localhost.localdomain> <48e37220912140241w27413491vbb462237e8569551@mail.gmail.com> <20091214110045.GA6906@localhost.localdomain> <48e37220912140425h3ce1a3en3efb276d69d9ee9d@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XOIedfhf+7KOe/yw" Content-Disposition: inline In-Reply-To: <48e37220912140425h3ce1a3en3efb276d69d9ee9d@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2009-q4/txt/msg00908.txt.bz2 --XOIedfhf+7KOe/yw Content-Type: multipart/mixed; boundary="huq684BweRXVnRxX" Content-Disposition: inline --huq684BweRXVnRxX Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2548 Hello Indraneel, I think I fixed this bug in git repo, see attached patch. I was only able to test it with arm emulator and cross-compiler and probes located in the kernel itself, not in modules, so if you could test it with native compilation and probes in modules it will be very good. This patch skips saving of build-id for kernels like one for ARM. I think the previous patch only worked because build-id check was skipped because of check in sym.c:261 (comment says "shouldn't happen"). Regards, Eugeniy Meshcheryakov 14 =D0=B3=D1=80=D1=83=D0=B4=D0=BD=D1=8F 2009 =D0=BE 17:55 +0530 Indraneel M= ukherjee =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=B2(-=D0=BB=D0=B0): > On Mon, Dec 14, 2009 at 4:30 PM, Eugeniy Meshcheryakov = wrote: > > Yes, I know about that problem. But I'm not sure whether proposed patch > > fixes anything. Were you able to _use_ modules made with that patch app= lied? >=20 > Yes, i was able to _use_ SystemTap on ARM after applying that patch + > your fix. I ran the following script and it worked absolutely fine: >=20 > global reads > probe kernel.function("do_writepages") { > reads[execname()]++ > } > probe timer.s(3) > { > foreach (count in reads) > printf("%s : %d \n", count, reads[count]) > } >=20 > OUTPUT of script: > pdflush : 4 > pdflush : 4 > pdflush : 8 > pdflush : 8 > pdflush : 12 > pdflush : 12 > pdflush : 12 > ... > ... > > Or does it fixes only compilation? My guess is that module > > initialization will fail because build-id does not match. >=20 > No it does not fail. >=20 > Regards, > Indro >=20 > > > > 14 =D0=B3=D1=80=D1=83=D0=B4=D0=BD=D1=8F 2009 =D0=BE 16:11 +0530 Indrane= el Mukherjee =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=B2(-=D0=BB=D0=B0): > >> Thanks for the fix. Also, there was another patch that i had to apply > >> to get Systemtap working for ARM. I checked the latest git and the fix > >> is not available for ARM. The fix is here: > >> http://sources.redhat.com/ml/systemtap/2009-q4/msg00574.html > >> Without the above fix, the ARM(arm-linux is non-relocatable) stap FAIL= S. > >> > >> This is related to > >> http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg69016= 6.html > >> > >> Shouldn't this fix be added to the Systemtap tree to get it right for = ARM? > > > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.10 (GNU/Linux) > > > > iEYEARECAAYFAksmGt0ACgkQKaC6+zmozOLZtwCfasFxn9Q8LgZgLQ59sKIEyJT3 > > dEMAoJC1rOkL/NN+mABa5p16hDqXMMV1 > > =3Dud4E > > -----END PGP SIGNATURE----- > > > > --huq684BweRXVnRxX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="build-id-arm.diff" Content-Transfer-Encoding: quoted-printable Content-length: 1199 commit 66f65c4fb0ddcdf8a85a29662a23a546cfd5dffe Author: Eugeniy Meshcheryakov Date: Tue Dec 15 14:17:51 2009 +0100 Don't save build-id if it is located before _stext =20=20=20=20 This probably means that build-id will not be loaded at all and happens for example with ARM kernel. =20=20=20=20 See also: http://sources.redhat.com/ml/systemtap/2009-q4/msg00574.html diff --git a/translate.cxx b/translate.cxx index 4b00615..aca0d86 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4909,7 +4909,14 @@ dump_unwindsyms (Dwfl_Module *m, c->output << ".num_sections =3D sizeof(_stp_module_" << stpmod_idx << "_= sections)/" << "sizeof(struct _stp_section),\n"; =20 - if (build_id_len > 0) { + /* Don't save build-id if it is located before _stext. + * This probably means that build-id will not be loaded at all and + * happens for example with ARM kernel. + * + * See also: + * http://sources.redhat.com/ml/systemtap/2009-q4/msg00574.html + */ + if (build_id_len > 0 && (build_id_vaddr > base + extra_offset)) { c->output << ".build_id_bits =3D \"" ; for (int j=3D0; joutput << "\\x" << hex --huq684BweRXVnRxX-- --XOIedfhf+7KOe/yw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline Content-length: 198 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAksnlBkACgkQKaC6+zmozOKIGQCdEiap7TFQhuQiIz9e1ewA+OCG AhkAn3LjlL7hsjTSRbJw/7wczoNfmjtI =mleX -----END PGP SIGNATURE----- --XOIedfhf+7KOe/yw--