From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id xDnpBCyP8WFsKwAAWB0awg (envelope-from ) for ; Wed, 26 Jan 2022 13:13:00 -0500 Received: by simark.ca (Postfix, from userid 112) id 03C8A1F3B6; Wed, 26 Jan 2022 13:13:00 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6E6081EA69 for ; Wed, 26 Jan 2022 13:12:59 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F3BA388C012 for ; Wed, 26 Jan 2022 18:12:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F3BA388C012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1643220778; bh=rsUA1KbTvi58wXO/mWVY0I8rYHyvzUuoKbUtfnrk7HU=; h=Date:To:References:Subject:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=EYBNo3mmgXdvhlHf1SmRHbq/nkCTGc7eYpJj0RRPbctvu6bD4V+rhRQcVlUtnrEpU wgqzJProheVwJF6y9E6CAEYbf5VllS23V7eHPrTUYPrAGc5ngHHREZ1X7AvY/NTx3y 6Iokfk+0bxir/pNIDdwSd7sODN1ZkK02qhs3EutA= Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by sourceware.org (Postfix) with ESMTPS id EAF7C385EC42 for ; Wed, 26 Jan 2022 18:12:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EAF7C385EC42 Received: from [2001:470:142:3::e] (port=38662 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCmmV-00032K-E5; Wed, 26 Jan 2022 13:12:32 -0500 Received: from ip5f5a8abe.dynamic.kabel-deutschland.de ([95.90.138.190]:51776 helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCmmV-0006Fa-5D; Wed, 26 Jan 2022 13:12:31 -0500 Message-ID: <6ae65bdc-e418-deef-4b7e-17cca9b1b8d8@gnu.org> Date: Wed, 26 Jan 2022 19:12:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: "Metzger, Markus T" References: <40aebee9-d4ed-3a94-2341-cc17beeb6431@gnu.org> <290cd354-3de0-9c0a-5bd7-48cc2ba9173e@gnu.org> Subject: Re: How to use bts recording? In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Sobisch via Gdb Reply-To: Simon Sobisch Cc: "gdb@sourceware.org" Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" Am 26.01.2022 um 18:11 schrieb Metzger, Markus T: > Hello Simon, > >>> Are you maybe using virtualization? >> >> Rechecked with the server team: yes, the old RHEL kernel runs on Redhat >> Virtualization Manager; the newer one on VMware vSphere. > > Here's the problem. AFAIK neither BTS nor PT are virtualized. This is simply > missing enabling in hypervisors. They do properly indicate this by omitting > the respective cpuid enumeration. This results in an EOPNOTSUPP when > GDB tries to enable it, which is printed by GDB. I see - but something is still not ideal. At least on this machine GDB 11.1 said: (gdb) record btrace bts Could not enable branch tracing for Thread 0x7ffff7fe4740 (LWP 2756): **Failed to start recording: Operation not supported** While the Debian GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git reports Could not enable branch tracing for Thread 0x7ffff79833c0 (LWP 334): **BTS support has been disabled for the target cpu** That's a clear message, I like that. Is this a special Debian patch or is because of the target cpu being AMD? Is there a path that should be taken when the OS reports EOPNOTSUPP? A message similar to the one above would be useful. > I'm afraid that's a fairly common problem, these days, but I don't see how > GDB could check that it is running in a guest OS and that the hypervisor did > not virtualize PT or BTS. As you've said: use of virtualized environments is quite common, so it may be reasonable to adjust the docs to at least hint at that issue. I suggest changing - Hardware-supported instruction recording, supported on Intel processors + Hardware-supported instruction recording, supported on Intel processors if not running in a virtual machine. ... or something like that. BTW: rechecked newer RHEL: GNU gdb (GDB) Red Hat Enterprise Linux 8.2-12.el8 also has the link to libipt and so also says Failed to open /sys/bus/event_source/devices/intel_pt/type [note: that message possibly could hint at "Intel PT not available"] Also: not sure if libipt is the one that is checking that directory, but possibly GDB could do this _before_ printing > Intel Processor Trace support was disabled at compile time. ... because this led me to believe "just reconfigure and possible install libipt before and everything will be fine" - but if I had done this the only result would have been another error message.