Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5147551imm; Tue, 31 Jul 2018 06:22:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe/dpXaQ1dUZZFoKgyUQjEg5vxU8CZSF6PBegxHGRevvSCHNJkugpTiQor3Rrt+Ed2alq5/ X-Received: by 2002:a17:902:b58b:: with SMTP id a11-v6mr20168293pls.34.1533043342849; Tue, 31 Jul 2018 06:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533043342; cv=none; d=google.com; s=arc-20160816; b=UlG1S1MUs3FfAz0GwHnJZYDF6yLgomohtOKl0nTsJ9qlkq45uNncS0MLi89Q5y6gXH kQR0HpA1DKIT/phK9KlIGQyfD3mF9kfmsJcaML0RRia3p+H59KzbmbBv5KYMh7dTSnum 8MTO9jTbLtmbt4Gfa8nH/FnrZtzI25KcJHsSgWOrgYE9QNwI6escnyV+BL7spIJt2fjJ N7oxldBQExxd52x6LIpuZJIPsO/zP3iIurv41zvMyE7TfHStIoCrT4FGa63LEZR3Bw49 X0odYRkck5v5POeWm5MEpzTyQA7uIycCupaLd1aFbd41oURZ7SvXcNhfZtZign3tf2HW DuvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Qi++3X6b2CnQ0bgMTT5A1SGym5U3KkOa40RlrYj2aYM=; b=aye7juMkVzXeAzgqAxOju7QA6xlzJI+J7DzllZH3hCHvqEoR1Qt9YWmlcdJg1d0LpH BJOFWLtb8se8qTq5HtzdkyPHM3rupt2YgH4ZRYEESVDM/cG3b45BbrQIT3Bv8X0i2hkl H0fDGjyaDUfmiuG1509Fhdp0qrYgBDCMSRMMS0PoflULRv72m6jJd3I6AE6VGgG9pAzq 1qEwu9Ck0cVDfOX7c5PR5ug9d7Bmh5KgjX+EGNnsci3u4wJ+ETMXpObXGpfbVyZaKpL5 X9ZRjoIfHQ9rqGd5lsT7j9SpHUrC519UfEhX2I1kIzMwzeh8wbN3VXwlBRhJZFX3pgQq J0rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=khB+hH3j; 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 q8-v6si13051438pfh.353.2018.07.31.06.22.08; Tue, 31 Jul 2018 06:22:22 -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=khB+hH3j; 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 S1732231AbeGaPBE (ORCPT + 99 others); Tue, 31 Jul 2018 11:01:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:51626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732110AbeGaPBE (ORCPT ); Tue, 31 Jul 2018 11:01:04 -0400 Received: from jouet.infradead.org (unknown [190.15.121.82]) (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 1378820894; Tue, 31 Jul 2018 13:20:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533043245; bh=ZUTLJ1AMns46orV7eMpll9+c8SVEORWg7voiZxvPjWM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=khB+hH3j9imbL+jtEOgYuRsozwWaKz1wx3sclj0UAzwAB8yYPUD3ye+0vcfhXoxqA RXnT5I4rw6gOT0YUidM1rvuOaFWISf4n9tWDsHcJz+YqA+IAQqeHIDC3MUwHHkeGFc BJh6J+PSXUhu1MHB6WZhAhVTwZ6/jABgY6d+QF7U= Received: by jouet.infradead.org (Postfix, from userid 1000) id 754F81403B8; Tue, 31 Jul 2018 10:20:42 -0300 (-03) Date: Tue, 31 Jul 2018 10:20:42 -0300 From: Arnaldo Carvalho de Melo To: Thomas Richter Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, Jiri Olsa , Namhyung Kim , Wang Nan , Daniel Borkmann Subject: Re: [PATCH v2] perf build: Fix installation directory for bpf Message-ID: <20180731132042.GA4909@kernel.org> References: <20180731073254.91090-1-tmricht@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180731073254.91090-1-tmricht@linux.ibm.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Jul 31, 2018 at 09:32:54AM +0200, Thomas Richter escreveu: > Output after using command ./perf test -Fv 40: > echo '...[bpf-program-source]...' | /usr/bin/clang ... \ > -I/root/lib/perf/include/bpf ... > ^^^^^^^^^^^^ > ... > [root@p23lp27 perf]# ./perf test -F 40 > 40: BPF filter : > 40.1: Basic BPF filtering : Ok > 40.2: BPF pinning : Ok > 40.3: BPF prologue generation : Ok > 40.4: BPF relocation checker : Ok > [root@p23lp27 perf]# So, testing it: [root@jouet perf]# cat tools/perf/examples/bpf/5sec.c // SPDX-License-Identifier: GPL-2.0 /* Description: . Disable strace like syscall tracing (--no-syscalls), or try tracing just some (-e *sleep). . Attach a filter function to a kernel function, returning when it should be considered, i.e. appear on the output. . Run it system wide, so that any sleep of >= 5 seconds and < than 6 seconds gets caught. . Ask for callgraphs using DWARF info, so that userspace can be unwound . While this is running, run something like "sleep 5s". . If we decide to add tv_nsec as well, then it becomes: int probe(hrtimer_nanosleep, rqtp->tv_sec rqtp->tv_nsec)(void *ctx, int err, long sec, long nsec) I.e. add where it comes from (rqtp->tv_nsec) and where it will be accessible in the function body (nsec) # perf trace --no-syscalls -e tools/perf/examples/bpf/5sec.c/call-graph=dwarf/ 0.000 perf_bpf_probe:func:(ffffffff9811b5f0) tv_sec=5 hrtimer_nanosleep ([kernel.kallsyms]) __x64_sys_nanosleep ([kernel.kallsyms]) do_syscall_64 ([kernel.kallsyms]) entry_SYSCALL_64 ([kernel.kallsyms]) __GI___nanosleep (/usr/lib64/libc-2.26.so) rpl_nanosleep (/usr/bin/sleep) xnanosleep (/usr/bin/sleep) main (/usr/bin/sleep) __libc_start_main (/usr/lib64/libc-2.26.so) _start (/usr/bin/sleep) ^C# Copyright (C) 2018 Red Hat, Inc., Arnaldo Carvalho de Melo */ #include int probe(hrtimer_nanosleep, rqtp->tv_sec)(void *ctx, int err, long sec) { return sec == 5; } license(GPL); [root@jouet perf]# perf trace --no-syscalls -e tools/perf/examples/bpf/5sec.c 0.000 perf_bpf_probe:hrtimer_nanosleep:(ffffffff9911efe0) tv_sec=5 3145.238 perf_bpf_probe:hrtimer_nanosleep:(ffffffff9911efe0) tv_sec=5 ^C[root@jouet perf]# After it works just the same, thanks, applying. I need to get the above testing process hooked up in 'perf test', so that besides adding that -I/root/lib/perf/include/bpf we actually _try_ to include something from there from the /root/lib/perf/examples/bpf/ bpf example scripts. - Arnaldo