Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp174693pxb; Wed, 3 Feb 2021 02:42:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxH1xHdl54YMIzKK1p1bdvs8pG9k3ybLEaUEkFyOrcYEDqGCgn3jpDGhQECKBkA28SDxjFB X-Received: by 2002:aa7:da55:: with SMTP id w21mr2344064eds.138.1612348976894; Wed, 03 Feb 2021 02:42:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612348976; cv=none; d=google.com; s=arc-20160816; b=TYt0iBVVx96F06lsrD5w48y79Pa8anmW6aJjBqI7bijJ5jL+IesXc0wiLmeYmlEWUb n6hAF3bTSLyMTF7Xcm24KYdxPAqDZvR8dW0UNXP/q3KtxCn1Kj7E1mh59eZoFv0VxGiu 55cEVQ1KR0SmHhihUezgQnFzIX1neML2xYP8raZpDZl3tADgN9ad1MGG/SKoD9shGhMy Z75xYxpE+igAYoh6GOzIHbvOcvrL6rw/TIrvcCtBtSZdCuW/tE40HcvFg4vshQVYVxbG He7MaqqxOCOjq+kZrh1XYt5dZ5Qath4SkYREEsf9Jxdv956B3cAOK8HBX1M8y86zhgqu nHmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=MKU4RibZleCAQVKq4S7yKb1XyHp4gY4evY8OijN5DtY=; b=iKKfs02ENOzNPqBp+556FlaDdVPPVHiDanwi/TVGMtO7bXKiTzTIcLugR1F0aLRLKF iUC5eTVta+87AtTa1Y8wpz5pvxoP+/dSKKtrRx2m+aCsNYYQ1QCItUgf8W4qQfT8KXxQ tW/taJ0fAgDBdqROe+68t+kTAqcDBwGLklowJtKix0z4TrJPJi1kH7g84Sj/JjBT/hVM XSqcou5WdituKqTf129amFNPq34gdDnMMFiLGYnt3lXZpWQsFf1DN92PXJ94XaNCXhzK 2XGJzZgg3Q8F7HPY+EigknyWhsvOsceyfG1F2j0tQowU1ZC7rTPam89sD3GnOFJ3U1lh 7SnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b20si422727ejp.678.2021.02.03.02.42.32; Wed, 03 Feb 2021 02:42:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233865AbhBCKlm (ORCPT + 99 others); Wed, 3 Feb 2021 05:41:42 -0500 Received: from elvis.franken.de ([193.175.24.41]:49448 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233684AbhBCKlj (ORCPT ); Wed, 3 Feb 2021 05:41:39 -0500 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1l7FaD-0005T6-04; Wed, 03 Feb 2021 11:40:25 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 45D7DC0D4A; Wed, 3 Feb 2021 11:40:09 +0100 (CET) Date: Wed, 3 Feb 2021 11:40:09 +0100 From: Thomas Bogendoerfer To: Tiezhu Yang Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li , David Daney , Ralf Baechle , Archer Yan Subject: Re: [PATCH 1/3] MIPS: kernel: Support extracting off-line stack traces from user-space with perf Message-ID: <20210203104009.GE7586@alpha.franken.de> References: <1609246561-5474-1-git-send-email-yangtiezhu@loongson.cn> <1609246561-5474-2-git-send-email-yangtiezhu@loongson.cn> <20210201104338.GA6484@alpha.franken.de> <7c081c6f-bf47-353d-95c0-52e8640dc938@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c081c6f-bf47-353d-95c0-52e8640dc938@loongson.cn> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 01, 2021 at 08:56:06PM +0800, Tiezhu Yang wrote: > On 02/01/2021 06:43 PM, Thomas Bogendoerfer wrote: > > On Tue, Dec 29, 2020 at 08:55:59PM +0800, Tiezhu Yang wrote: > > > +++ b/arch/mips/include/uapi/asm/perf_regs.h > > > @@ -0,0 +1,42 @@ > > > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > > > +#ifndef _ASM_MIPS_PERF_REGS_H > > > +#define _ASM_MIPS_PERF_REGS_H > > > + > > > +enum perf_event_mips_regs { > > > + PERF_REG_MIPS_PC, > > > + PERF_REG_MIPS_R1, > > > + PERF_REG_MIPS_R2, > > > + PERF_REG_MIPS_R3, > > > + PERF_REG_MIPS_R4, > > > + PERF_REG_MIPS_R5, > > > + PERF_REG_MIPS_R6, > > > + PERF_REG_MIPS_R7, > > > + PERF_REG_MIPS_R8, > > > + PERF_REG_MIPS_R9, > > > + PERF_REG_MIPS_R10, > > > + PERF_REG_MIPS_R11, > > > + PERF_REG_MIPS_R12, > > > + PERF_REG_MIPS_R13, > > > + PERF_REG_MIPS_R14, > > > + PERF_REG_MIPS_R15, > > > + PERF_REG_MIPS_R16, > > > + PERF_REG_MIPS_R17, > > > + PERF_REG_MIPS_R18, > > > + PERF_REG_MIPS_R19, > > > + PERF_REG_MIPS_R20, > > > + PERF_REG_MIPS_R21, > > > + PERF_REG_MIPS_R22, > > > + PERF_REG_MIPS_R23, > > > + PERF_REG_MIPS_R24, > > > + PERF_REG_MIPS_R25, > > > + /* > > > + * 26 and 27 are k0 and k1, they are always clobbered thus not > > > + * stored. > > > + */ > > haveing this hole here make all code more complicated. Does it hurt > > to have R26 and R27 in the list ? > > I think there is no effect if have R26 and R27 in the list. > > In the perf_reg_value(), PERF_REG_MIPS_R{26,27} are default case. why make them special ? After all they are real registers and are only defined special by current ABIs. > Should I modify enum perf_event_mips_regs to add R26 and R27, > and then send v2? yes please. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]