From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25353 invoked by alias); 14 Dec 2011 13:09:41 -0000 Received: (qmail 25324 invoked by uid 22791); 14 Dec 2011 13:09:39 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,TW_KG,TW_SV X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Dec 2011 13:09:24 +0000 Received: by faao14 with SMTP id o14so1388949faa.0 for ; Wed, 14 Dec 2011 05:09:22 -0800 (PST) Received: by 10.180.106.105 with SMTP id gt9mr5593109wib.39.1323868161834; Wed, 14 Dec 2011 05:09:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.151.11 with HTTP; Wed, 14 Dec 2011 05:08:39 -0800 (PST) In-Reply-To: References: From: Hui Zhu Date: Wed, 14 Dec 2011 13:09:00 -0000 Message-ID: Subject: Re: KGTP (Linux Kernel debugger and tracer) 20111111 release (Android support OK) To: Geunsik Lim Cc: linux-kernel@vger.kernel.org, "gdb@sourceware.org" , kgtp , Marc Khouzam , Thiago Jung Bauermann , Steven , colyli@gmail.com, Christoph Hellwig , Steven Rostedt , Randy Dunlap Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00025.txt.bz2 Hi Geunsik, I just add a new patch gtp_3.0_to_upstream.patch that can patch Linux Kernel from 3.0 to upstream in kgtp trunk. I think maybe it can handle your issue. Could you help me try it? Thanks, Hui On Tue, Dec 13, 2011 at 09:36, Geunsik Lim wrote: > On Mon, Dec 12, 2011 at 11:05 PM, Hui Zhu wrote: >> Hi Geunsik, >> >> Thanks for your patch. >> But =A0Kernel upstream: >> struct perf_event * >> perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct t= ask_struct *task, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 perf_ove= rflow_handler_t overflow_handler, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *co= ntext) >> >> I am sorry that gtp.patch is just for the Kernel upstream (Actually, >> it just for review). >> >> I suggest you use LKM if it is OK for you. > As you mentioned, LKM is normal in my experience. > But, In embedded environment, built-in kernel including KGTP is important > to debugging instantly without any manipulation and =A0to review accordin= g to > volunteers easily. > >> >> If you want include KGTP into your kernel tree or something, maybe I >> can supply a special patch for you. > I think that you can just append exception handling to solve this > issue like belows. > Or, I will suggest for you will keep kgtp-3.1.1.patch =A0without > kgtp.patch like linux-kernel-rt patch for each kernel version > > =3D=3D=3D=3D > diff --git a/lib/gtp.c b/lib/gtp.c > index 9bdf82c..6253811 100644 > --- a/lib/gtp.c > +++ b/lib/gtp.c > @@ -4477,10 +4477,17 @@ restart: > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Get event. =A0*/ > +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(3, 1, 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tve->pts->event =3D > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0perf_event_create_kernel_c= ounter(&(tve->pts->attr), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tve->pts->cpu, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 NULL, NULL, NULL); > +#else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 tve->pts->event =3D > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 perf_event_create_kernel_co= unter(&(tve->pts->attr), > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tve->pts->cpu, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL, NULL); > +#endif > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (IS_ERR(tve->pts->event)) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0int =A0 =A0 ret =3D PTR_ER= R(tve->pts->event); > > =3D=3D=3D=3D > >> >> BTW looks I need release an gtp_auto.patch that can patch to most of >> Linux kernel. >> >> Thanks, >> Hui >> >> On Mon, Dec 12, 2011 at 19:13, Geunsik Lim wrote: >>> On Mon, Nov 14, 2011 at 2:15 PM, Hui Zhu wrote: >>>> KGTP is a realtime and lightweight Linux Kernel GDB debugger and trace= r. >>>> >>>> It makes Linux Kernel supply a GDB remote debug interface. Then GDB in >>>> current machine or remote machine can debug and trace Linux through >>>> GDB tracepoint without stopping the Linux Kernel. >>>> And even if the board doesn't have GDB on it and doesn't have >>>> interface for remote debug. It can debug the Linux Kernel using >>>> offline debug. >>>> Now, it supports X86-32, X86-64, MIPS and ARM. >>>> >>>> Now, KGTP 20111111 release. >>>> >>>> The change of this release is: >>>> Add a doc for use KGTP with Android in >>>> https://code.google.com/p/kgtp/wiki/HowToUseKGTPinAndroid >>>> post_handler will make kprobes-optimization cannot be used. So make >>>> gtp_kp_post_handler be call only when tpe->step is true. >>>> Make rdtsc_current to x86 special. >>>> Register easy Kprobe handler to speed up it when no tracepoint access >>>> $cooked_clock, $cooked_rdtsc or "pc_pe" tvariable. >>>> Fix a bug of ARM build. >>>> To get other change info please goto https://code.google.com/p/kgtp/wi= ki/UPDATE >>>> >>>> According to the comments of Christoph. =A0I make a patch for Linux >>>> Kernel and make it looks OK with checkpatch.pl. =A0The file gtp.patch = is >>>> include in the source of KGTP code. >>> Dear Hui Zhu, >>> >>> Recently, I synchronized KGTP kernel source with svn 838 to test >>> built-in kernel >>> after adjusting recent bug-fix. I still had a compilation error. >>> Please, adjust the below patch content to support =A0X86/ARM >>> architecture normally. >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> From 39d58cc7dab8df5e57fa106e8e7f00e562b45212 Mon Sep 17 00:00:00 2001 >>> From: Geunsik Lim >>> Date: Mon, 10 Dec 2011 18:08:03 +0900 >>> Subject: [PATCH] Modify perf related func interface. >>> >>> Signed-off-by: Geunsik Lim >>> Signed-off-by: Kyungmin Park >>> --- >>> =A0lib/gtp.c | =A0 =A02 +- >>> =A01 files changed, 1 insertions(+), 1 deletions(-) >>> >>> diff --git a/lib/gtp.c b/lib/gtp.c >>> index 9bdf82c..9a2670e 100644 >>> --- a/lib/gtp.c >>> +++ b/lib/gtp.c >>> @@ -4480,7 +4480,7 @@ restart: >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tve->pts->event =3D >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0perf_event_create_kernel= _counter(&(tve->pts->attr), >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tve->pts->cpu, >>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL, NULL, NULL); >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0NULL, NULL); >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (IS_ERR(tve->pts->event)) { >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0int =A0 =A0 ret =3D PTR_= ERR(tve->pts->event); >>> >>> -- >>> 1.7.3.4 >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> >>> Thank you for your contribution for embedded kernel debugging >>> >>>> >>>> Thanks, >>>> Hui >>>> -- >>>> To unsubscribe from this list: send the line "unsubscribe linux-kernel= " in >>>> the body of a message to majordomo@vger.kernel.org >>>> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html >>>> Please read the FAQ at =A0http://www.tux.org/lkml/ >>> >>> >>> >>> -- >>> Best regards, >>> Geunsik Lim ( Samsung Electronics ) >>> Blog : http://blog.naver.com/invain/ >>> Homepage: http://leemgs.fedorapeople.org >>> -- >>> To unsubscribe from this list: send the line "unsubscribe linux-kernel"= in >>> the body of a message to majordomo@vger.kernel.org >>> More majordomo info at=A0 http://vger.kernel.org/majordomo-info.html >>> Please read the FAQ at=A0 http://www.tux.org/lkml/ > > > > -- > Best regards, > Geunsik Lim ( Samsung Electronics ) > Blog : http://blog.naver.com/invain/ > Homepage: http://leemgs.fedorapeople.org > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at=A0 http://vger.kernel.org/majordomo-info.html > Please read the FAQ at=A0 http://www.tux.org/lkml/