Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp561449imd; Sat, 3 Nov 2018 06:02:12 -0700 (PDT) X-Google-Smtp-Source: AJdET5d3ku042nPcJXnlbfphE9r6XphDGA4PEQVbD20TZqr1fN7YfR6+26ar+glvc8GAPaj4oUmc X-Received: by 2002:a17:902:da8:: with SMTP id 37-v6mr15505617plv.12.1541250132849; Sat, 03 Nov 2018 06:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541250132; cv=none; d=google.com; s=arc-20160816; b=xgng7v/4NAG/niE8H+WE8dmfaUPEXTPScL7ElMRxcv3IzQTUupZyhJUz91V3IAm6MC +2aqYX22aD0sPF4/qI/z1nMDCs8xW9TwXvGXUTFpY5/rKs+jGCYweN2dlxCOj6FRAe1R uM025jw55kFK3KANDfeEo1OUP0ZlRewCD2a/QOD84x4WawbcB8jGMJNxSVxWs8DimDIF XesJh1l931r8iEYuGWFHrWCLzg+r9ZS6WJLBc8XPl9C9U0rEWxKoZM9dq4wW6DZAcpqV rRgY4BVysJy1X3rfcjTgJLHeKSWQe5LMb5AZrCWZiq9i3GH7cSsj7uc8f9q+L7f9fYi7 liVg== 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 :dkim-signature; bh=msaUjty4CWi5pCj1087k0VAHAWHtnAZqG40WrHAOC0U=; b=Lkgt61YGuGZVgro1gXooqhKFNKUyd+HoywVLZYKvoJV3RVM7Zo0nfCK7p7Vzne0f4Q X50CPkVYXnH4+XLgtUmwxa6S2ROGZ9ROWd/BsvXOkb7BFg5q+l6AZdBh+/DJGmIgnOkV Q7IkXYGvI8TA0E/JeDZqVTOvOKer8N3e2nQTe9FO2aL4GrIL8YiRHBc+xPwKtPx5b23y WkhVn2CQjjjpMEQ6oJVSKkTZdJHtGP3qdMkJwQQyPRFodUSa6hPDToMahjNbW9LCYdwD 2vi9pWxCZxvNdNAeRuvpd0OlJVvMRx3q5L3UDmds9a3IAI1eeChouNgQV50QfSvLBYMn VpDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eroBnljk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a123-v6si36604626pgc.219.2018.11.03.06.01.57; Sat, 03 Nov 2018 06:02:12 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=eroBnljk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728596AbeKCWLe (ORCPT + 99 others); Sat, 3 Nov 2018 18:11:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:43238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727658AbeKCWLe (ORCPT ); Sat, 3 Nov 2018 18:11:34 -0400 Received: from devbox (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (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 BAB952081D; Sat, 3 Nov 2018 13:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541250017; bh=RDauV+NAnIZ1z++791qv+a8po41ID1/JFFCThntouls=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eroBnljkhNSjUsITF/cZidAslPLJ2ppXxa4t+K8vA7rKPpwIYqSjODrcIrRWjb+4V Rr9tp5Vjkntf+7iqs4BJWRlnDCvkiMHDFWSVSFBCR+sFGVU0i/KtCbVr7ZRZZa9Ayf I9BwxV7Umj9YeisGzZ7EQUUFinUZKD4kSFFR4EBw= Date: Sat, 3 Nov 2018 22:00:12 +0900 From: Masami Hiramatsu To: Steven Rostedt Cc: Josh Poimboeuf , Aleksa Sarai , "Naveen N. Rao" , Anil S Keshavamurthy , "David S. Miller" , Masami Hiramatsu , Jonathan Corbet , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Shuah Khan , Alexei Starovoitov , Daniel Borkmann , Brendan Gregg , Christian Brauner , Aleksa Sarai , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v3 1/2] kretprobe: produce sane stack traces Message-Id: <20181103220012.55ecd97e671c43e4959c8b62@kernel.org> In-Reply-To: <20181102121307.32e99414@gandalf.local.home> References: <20181101083551.3805-1-cyphar@cyphar.com> <20181101083551.3805-2-cyphar@cyphar.com> <20181101204720.6ed3fe37@vmware.local.home> <20181102050509.tw3dhvj5urudvtjl@yavin> <20181102065932.bdt4pubbrkvql4mp@yavin> <20181102091658.1bc979a4@gandalf.local.home> <20181102154325.bt6xoysl4xdl33wd@treble> <20181102121307.32e99414@gandalf.local.home> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-redhat-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 Fri, 2 Nov 2018 12:13:07 -0400 Steven Rostedt wrote: > On Fri, 2 Nov 2018 10:43:26 -0500 > Josh Poimboeuf wrote: > > > > I'll hopefully have a prototype ready by plumbers. > > > > Why do we need multiple users? It would be a lot simpler if we could > > just enforce a single user per fgraphed/kretprobed function (and return > > -EBUSY if it's already being traced/probed). > > Because that means if function graph tracer is active, then you can't > do a kretprobe, and vice versa. I'd really like to have it working for > multiple users, then we could trace different graph functions and store > them in different buffers. It would also allow for perf to use function > graph tracer too. Steve, how woul you allow multiple users on it? Something like this? ret_trampoline_multiple(){ list_for_each(handler, &shadow_entry[i].handlers, list) handler(shadow_entry[i]); restore_retval_and_jump_to(shadow_entry[i].orig); } > > > And this too will require each architecture to probably change. As a > > > side project to this, I'm going to try to consolidate the function > > > graph code among all the architectures as well. Not an easy task. > > > > Do you mean implementing HAVE_FUNCTION_GRAPH_RET_ADDR_PTR for all the > > arches? If so, I think have an old crusty patch which attempted to > > that. I could try to dig it up if you're interested. > > > > I'd like to have that, but it still requires some work. But I'd just > the truly architecture dependent code be in the architecture (basically > the asm code), and have the ability to move most of the duplicate code > out of the archs. I will also do that for kretprobe handlers. Thank you, -- Masami Hiramatsu