From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37603 invoked by alias); 6 Sep 2016 16:48:49 -0000 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 Received: (qmail 37567 invoked by uid 89); 6 Sep 2016 16:48:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:2366, GMT-04, gmt-04, gmt04 X-HELO: mail-qk0-f178.google.com Received: from mail-qk0-f178.google.com (HELO mail-qk0-f178.google.com) (209.85.220.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Sep 2016 16:48:38 +0000 Received: by mail-qk0-f178.google.com with SMTP id v123so223697475qkh.2 for ; Tue, 06 Sep 2016 09:48:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6m4BWQ4u4KrNkWaC6nXfCdSv9KcM4qeJduqf5HCTKsw=; b=Cz9w2dVlaZSIcUigLlgKKNXZXT7PCPNhoC5NEKgpmZri4Oqzh+kesX/lYkq06D2JWf a8Gw/4qUw34afpeRNrSXdJY/VZU3EFZVNrjKXY+GilQS+4rupo8vOz3beT9+JarSSdE8 Cw3hIsyW4d+7xTQWrtrCLEQQ4d4Q4OluUJ+q7GfSZL470KIytu4xUXYaJicbYkptr3UH xN3CllYyzhe05bJ5rrc3ID7TlBMVGlvOubSTovfebyjf+Nhn/Q1DXqSUY3+6wwInR0L2 UfNffnmnq+LWCR91sbSRfuk9sYbh5xThB3maLgAxwGL5WwWEBBXwMdvCNjeaUfDF6jaK zyNw== X-Gm-Message-State: AE9vXwM+CKur2VFpmcCfT87XwFLueMRot3tyyrplFqE0cL/GukZW6JJ6IRaA/1w9GFE77xzUXgeiGCmW2aX6pA== X-Received: by 10.55.180.2 with SMTP id d2mr47230698qkf.175.1473180517068; Tue, 06 Sep 2016 09:48:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.44.7 with HTTP; Tue, 6 Sep 2016 09:48:06 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?B?5oWV5Yas5Lqu?= Date: Tue, 06 Sep 2016 16:48:00 -0000 Message-ID: Subject: Re: Could not use "record btrace" even if I have Intel PT hardware feature To: "Metzger, Markus T" Cc: "gdb@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00037.txt.bz2 -- My best regards to you. No System Is Safe! Dongliang Mu 2016-09-06 10:59 GMT-04:00 Metzger, Markus T : >> -----Original Message----- >> From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On >> Behalf Of ??? >> Sent: Tuesday, September 6, 2016 4:37 PM >> To: gdb@sourceware.org >> Subject: Could not use "record btrace" even if I have Intel PT hardware feature > > Hello Dongliang, > >> I encounter one problem when I try to leverage Intel PT to do branch tracing. >> >> My cpu has Intel PT feature via "grep intel_pt /proc/cpuinfo". >> >> $ grep intel_pt /proc/cpuinfo >> >> flags : ...intel_pt... >> >> >> $ gdb simple >> ....... >> (gdb) b main >> Breakpoint 1 at 0x40050c >> (gdb) r >> Starting program: .../Work/Projects/simple >> >> Breakpoint 1, 0x000000000040050c in main () >> (gdb) record btrace >> Target does not support branch tracing. >> (gdb) record btrace pt >> GDB does not support Intel Processor Trace. > > You need a kernel that supports it (4.1+) and you need a GDB that supports it. I am using Debian Testing with linux kernel 4.6.0-1 and gdb 7.11.1-2 > > Newer Linux distributions should already provide GDB with Intel PT support. If > your distribution doesn't or if you want to build GDB yourself, please configure > it with "--with-intel-pt". > I have installed libipt-dev and libipt1 packages. > If your Linux distribution does not provide libipt(-devel), you may need to > build it yourself. You can get the sources from here: > https://github.com/01org/processor-trace. > > You may also need to configure GDB with "--with-libipt-prefix=" > if you don't (want to) install libipt in a standard place. > > You may further need to install kernel headers - GDB needs > /usr/include/linux/perf_event.h. > And I have checked the existence of /usr/include/linux/perf_event.h. Should I reboot my Debian to make kernel module for Intel PT effective? > Regards, > Markus. > > Intel Deutschland GmbH > Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de > Managing Directors: Christin Eisenschmid, Christian Lamprechter > Chairperson of the Supervisory Board: Nicole Lau > Registered Office: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928