Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754514AbbGWXAA (ORCPT ); Thu, 23 Jul 2015 19:00:00 -0400 Received: from mail-yk0-f174.google.com ([209.85.160.174]:35266 "EHLO mail-yk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753642AbbGWW76 (ORCPT ); Thu, 23 Jul 2015 18:59:58 -0400 Subject: Re: [PATCH v3 3/3] samples/bpf: example of get selected PMU counter value To: Kaixu Xia , davem@davemloft.net, acme@kernel.org, mingo@redhat.com, a.p.zijlstra@chello.nl, masami.hiramatsu.pt@hitachi.com, jolsa@kernel.org References: <1437644562-84431-1-git-send-email-xiakaixu@huawei.com> <1437644562-84431-4-git-send-email-xiakaixu@huawei.com> Cc: wangnan0@huawei.com, linux-kernel@vger.kernel.org, pi3orama@163.com, hekuang@huawei.com From: Alexei Starovoitov Message-ID: <55B171EB.30203@plumgrid.com> Date: Thu, 23 Jul 2015 15:59:55 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <1437644562-84431-4-git-send-email-xiakaixu@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 694 Lines: 20 On 7/23/15 2:42 AM, Kaixu Xia wrote: > This is a simple example and shows how to use the new ability > to get the selected Hardware PMU counter value. > > Signed-off-by: Kaixu Xia ... > +struct bpf_map_def SEC("maps") my_map = { > + .type = BPF_MAP_TYPE_PERF_EVENT_ARRAY, > + .key_size = sizeof(int), > + .value_size = sizeof(unsigned long), > + .max_entries = 32, > +}; wait. how did it work here? value_size should be u32. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/