Received: by 10.223.185.116 with SMTP id b49csp4516136wrg; Tue, 6 Mar 2018 18:01:53 -0800 (PST) X-Google-Smtp-Source: AG47ELs4rNxT5vZuI5DALs/aQzCYBG2A5npNYaEgywv/tAhBui0IE+Peaj6UCUwzxA6D007tHx9n X-Received: by 2002:a17:902:7509:: with SMTP id i9-v6mr19127909pll.220.1520388113267; Tue, 06 Mar 2018 18:01:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520388113; cv=none; d=google.com; s=arc-20160816; b=013m5JMnwtxYIk4L3PAzuY26xU27arVr6V2z6AQHXBGLYPxQ1UA264gnXIno6qRNWk NC/d06oJb9quklfkVDbcx0XanCvVWFakKNA24pb1XMG4tIbHqD/EG7xynkuqKzg7rx2R s4N6jgJBcs9rzdoTUPjCntStSUCd6eYiWYEMwOgTTVO5RX7RFi7eoxkpD9lJUd2RJzu6 Z28D91RDp8TfOfZMx4njUDLFCVNtSJBDSnQ0wqsU6hnub89HU/38rDRb5HmhTlDmB8q3 I0D53bZiHXxMLN82MTdUlLGkmqp3TJICnl2CLsboswoFo0QWhWXuIKmuX6pg2nSi4QJN BSYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=Ca2Z056gddk4HhZYbLcE5PXe8Ggufp0Ln9KmZryzqNo=; b=PJG7RnRxR0f9Sl+ohU+hAOH92FNVJt2AHo4KpIAAW1AtiXAsamFwqN+j1ynRCdbsaJ v5iJMRzQZuYb1phgHoeirF11Qb1Z4oTTTv07gVREjFlIUUvQTHZOWvWEpH9iYbpu3qcJ xy9WNy298kOirEqwlbfd63W5CPM0YJDgNNhbhWE/QOmGVajECFuIg5ckkmqMyXpAVqV1 r+exvTf5YLWLn+9LhGcV02q3tBeK+HUQErYpn2rf/L7e92ylvaXHiy1SWRFu22Rd/JKY GoHkjx+dNlxhzoW2qTTmWLNCsB/lhZcaWrGhmxuLZktIWZfPRYjqnf5lmfytqiSFS6V4 xxtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si10670923pgp.632.2018.03.06.18.01.38; Tue, 06 Mar 2018 18:01:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933173AbeCGCAo (ORCPT + 99 others); Tue, 6 Mar 2018 21:00:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:37752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932078AbeCGCAn (ORCPT ); Tue, 6 Mar 2018 21:00:43 -0500 Received: from vmware.local.home (unknown [208.91.3.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9697F20685; Wed, 7 Mar 2018 02:00:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9697F20685 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Tue, 6 Mar 2018 21:00:41 -0500 From: Steven Rostedt To: Alan Kao Cc: Palmer Dabbelt , Albert Ou , "sw-dev@groups.riscv.org" , "linux-kernel@vger.kernel.org" , "Greentime Ying-Han =?UTF-8?B?SHU=?=(=?UTF-8?B?6IOh6Iux5ryi?=)" , "Zong Zong-Xian =?UTF-8?B?TGk=?=( =?UTF-8?B?5p2O5a6X5oay?=)" Subject: Re: ftrace: Proposal for an Alternative RecordMcount framework Message-ID: <20180306210041.56736b13@vmware.local.home> In-Reply-To: <20180307014746.GA25460@andestech.com> References: <20180227100425.GB20904@andestech.com> <20180227161252.25162d81@vmware.local.home> <20180301020507.GA24550@andestech.com> <20180307014746.GA25460@andestech.com> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Mar 2018 09:47:47 +0800 Alan Kao wrote: > > Please allow me to state the problem more clearly here. I hope this helps. > > > > 1. locations of mcount are recorded in a per-file basis. > > 2. to optimize the binary, the linker turns on some aggressive > > options, including relaxation. > > 3. the optimizations changes the original offset. > > 4. already recorded mcount call-sites no longer point to their > > real positions. > > 5. still a linked vmlinux is made. > > 6. dynamic ftrace breaks the real logic in the kernel space, > > panics happen. > > > > Thanks, > > Alan > > Any comments on this? Sorry, I've been traveling and falling behind in this. I did read this when I was offline but forgot to reply when I was back online. > > BTW, the introduced framework has no effects on any other architectures that > works fine. This feature should be configurable and turned on only when the > arch has aggressive link-time optimizations. > > If you consider this appropriate, I will send the patch to this once it gets > ready. Currently this is targeting at RISC-V and upcoming NDS32. I see the issue you explained above and it makes sense. Perhaps make it an option that can be enabled by anyone, and archs that require aggressive link time optimizations would just select it. -- Steve