Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755441AbcKOEdK (ORCPT ); Mon, 14 Nov 2016 23:33:10 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:10478 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755180AbcKOEdI (ORCPT ); Mon, 14 Nov 2016 23:33:08 -0500 Subject: Re: [PATCH 00/34] perf clang: Builtin clang and perfhook support To: , References: <20161115040617.69788-1-wangnan0@huawei.com> CC: , , , , Jiri Olsa From: "Wangnan (F)" Message-ID: <582A8FD2.1010502@huawei.com> Date: Tue, 15 Nov 2016 12:32:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20161115040617.69788-1-wangnan0@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1193 Lines: 43 On 2016/11/15 12:05, Wang Nan wrote: > $ sudo -s > # ulimit -l unlimited > # perf record -e ./count_syscalls.c echo "Haha" > Start count, perfpid=25209 > Haha > [ perf record: Woken up 1 times to write data ] > syscall 8 count: 6 > syscall 11 count: 1 > syscall 4 count: 6 > syscall 21 count: 1 > syscall 5 count: 3 > syscall 231 count: 1 > syscall 45 count: 3 > syscall 0 count: 24 > syscall 257 count: 1 > syscall 59 count: 4 > syscall 23 count: 9 > syscall 78 count: 2 > syscall 41 count: 4 > syscall 72 count: 8 > syscall 10 count: 3 > syscall 321 count: 1 > syscall 298 count: 7 > syscall 16 count: 21 > syscall 9 count: 16 > syscall 1 count: 114 > syscall 12 count: 3 > syscall 14 count: 35 > syscall 158 count: 1 > syscall 2 count: 15 > syscall 7 count: 18 > syscall 3 count: 11 > [ perf record: Captured and wrote 0.011 MB perf.data ] Note that this example counts system wide syscall histogram, not only 'echo' proc. The in-kernel BPF script doesn't know pid of 'echo' so can't filter base on it. I'm planning adding more perf hook points to pass information like this. Thank you.