Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp929570pxb; Fri, 15 Oct 2021 20:30:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyG59NcJ98itzNDsZBve3DUn/Z8hi9PAIsBT2N8h+gNuehQrDn6KVA2uhbOW9jVq9PT/eJK X-Received: by 2002:a17:906:3bca:: with SMTP id v10mr11521927ejf.9.1634355008416; Fri, 15 Oct 2021 20:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634355008; cv=none; d=google.com; s=arc-20160816; b=Bh3QMM3oudgYhR15ikQsDmKFmZSEPf+SlArEeGXGlWPbDQCycDl7Tci5ziclMON7jI HmxDSMgrUvFHBfj4JXbVXSey6+VEeKL7L2TDHdc7L/0PVxXIvh/A3423i5Z5GzeWIJ87 /tk06yFzcV7FyT7UjWvQdw2f2i3V6HcNr09eQ9lwS11qIltCjfP+YFcTzk4+Idr1e3sQ aLlsXbLFg5S/4fA4+oehKXbpuQw5ElUREUVVj4gjyVnkdGOQhnkLUZuIl4Rw0NrYdrgX gwZSBgu+z4ZrBJqexaXdaq/dD07gL8rM0CWMNs8D5cxgCQ5/EF1XzQ+qgoOq08RZ+tF0 QIEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9UGX3++Muv5IKlC42g5Ts1VTZ5nEDwfN1m96XDJmX/Y=; b=I/bOWVU0Q9B6MCZ5xYjDy/uwsJYOtmSVhEBtdFtpNYkoufxk/8aik2y4OYkcCZYLDc z5/BU0KabRKVYkht4F8/K7ARKINR9SQ1Xw7UBJYObylgRcsibfkieDvzr6Ofx0PzAeFG JVnPps6n593Z/G8xUa9BQXQnvgc5GOVq0PqUBYMTGFnCxd0+5xhna7FEsqsN2SMdAN3D tuvID2I4r7BJvcAycE9jwlVaP1suU4h9GuhJVxB19hFkoG7nB1H/FY0O8I/eUl0l/dXJ wt3ZnVpqZEM17l244x/FrlDME9SP4gIMMLrwPL7I1I4A8YU4zoRMlDgwuiN1p91qOZ/7 AyLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RbWTn8uD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w15si9900242eds.603.2021.10.15.20.29.45; Fri, 15 Oct 2021 20:30:08 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RbWTn8uD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239333AbhJONM0 (ORCPT + 99 others); Fri, 15 Oct 2021 09:12:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:34022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239332AbhJONMY (ORCPT ); Fri, 15 Oct 2021 09:12:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 11D53611C3; Fri, 15 Oct 2021 13:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634303417; bh=P2BeoMAkiudgWbX946jwmj5l1omZI6aI6TZn2ZUN/qo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RbWTn8uDLhWZ3wR8CjLDbw8l54/rsXfq9bmxmiYRd2Ix6wKON8XFvc8ELxtzhkyTY 4yNgIxNc2KikAH9IO5Y5dtBYdEgf32Jf1P85OxgXa4i6TP22eXEvjsY+1QgDzvOWeB /ahRphw5njZIRA6ghGbDO864TBDIQQgutdyw6an83eALSf3y1o8a/dumBlGobjUZz5 XzgN7jp+Mtmy+2aU4hb3eqVbg+DdDPIVE0xx0UyivKxhPY7034/SztT+1ABJH8fX1z 0mWlXe0uqyR6+p5dysE0HYOcgCusBVz0Twb2KiSUvJXdO2/xcCx1ZtifLpCsMNsuPE HT+we5v/MPD8Q== Date: Fri, 15 Oct 2021 22:10:14 +0900 From: Masami Hiramatsu To: Masami Hiramatsu Cc: Steven Rostedt , "Naveen N . Rao" , Ananth N Mavinakayanahalli , Ingo Molnar , linux-kernel@vger.kernel.org, Sven Schnelle , Catalin Marinas , Will Deacon , Russell King , Nathan Chancellor , Nick Desaulniers , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 03/10] x86/unwind: Compile kretprobe fixup code only if CONFIG_KRETPROBES=y Message-Id: <20211015221014.5be86007034a5ed9356848b3@kernel.org> In-Reply-To: <163430227030.459050.12754362425825951410.stgit@devnote2> References: <163430224341.459050.2369208860773018092.stgit@devnote2> <163430227030.459050.12754362425825951410.stgit@devnote2> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Oct 2021 21:51:10 +0900 Masami Hiramatsu wrote: > Compile kretprobe related stacktrace entry recovery code and > unwind_state::kr_cur field only when CONFIG_KRETPROBES=y. Oh, this is another new patch, and is a kind of cleanup. No functionality change, but a bit reducing memory usage when CONFIG_KRETPROBES=n. Thank you, > > Signed-off-by: Masami Hiramatsu > --- > arch/x86/include/asm/unwind.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/x86/include/asm/unwind.h b/arch/x86/include/asm/unwind.h > index fca2e783e3ce..2a1f8734416d 100644 > --- a/arch/x86/include/asm/unwind.h > +++ b/arch/x86/include/asm/unwind.h > @@ -16,7 +16,9 @@ struct unwind_state { > unsigned long stack_mask; > struct task_struct *task; > int graph_idx; > +#ifdef CONFIG_KRETPROBES > struct llist_node *kr_cur; > +#endif > bool error; > #if defined(CONFIG_UNWINDER_ORC) > bool signal, full_regs; > @@ -105,9 +107,13 @@ static inline > unsigned long unwind_recover_kretprobe(struct unwind_state *state, > unsigned long addr, unsigned long *addr_p) > { > +#ifdef CONFIG_KRETPROBES > return is_kretprobe_trampoline(addr) ? > kretprobe_find_ret_addr(state->task, addr_p, &state->kr_cur) : > addr; > +#else > + return addr; > +#endif > } > > /* Recover the return address modified by kretprobe and ftrace_graph. */ > -- Masami Hiramatsu