From mboxrd@z Thu Jan 1 00:00:00 1970 From: Elazar Leibovich Subject: Re: perf smapling Date: Tue, 31 Mar 2015 21:07:49 +0300 Message-ID: References: <20150331111813.GA1152@ubuntu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-ie0-f171.google.com ([209.85.223.171]:35106 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752657AbbCaSHu (ORCPT ); Tue, 31 Mar 2015 14:07:50 -0400 Received: by ierf6 with SMTP id f6so22947483ier.2 for ; Tue, 31 Mar 2015 11:07:49 -0700 (PDT) In-Reply-To: Sender: linux-perf-users-owner@vger.kernel.org List-ID: To: sahil aggarwal Cc: linux-perf-users@vger.kernel.org Look at the man page, you should set the type to PERF_TYPE_TRACEPOINT and set the config to the event id. On my system, sys_enter_open event id is 455 $ sudo cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_open/id 455 Add PERF_SAMPLE_RAW to the sample_type. BTW You can compile the tar.gz I sent and echo JSON in the attr format to it, it'll print back perf data in json format. Easier to experiment with perf_event_open API than writing a C program. For example $ make $ sudo ./perf2 < wrote: > Actually i need most of the sampling around PERF_TYPE_TRACEPOINT, > so if i enable tracepoint "syscalls/sys_enter_open/" what will be the "type" > field in perf_event_header.? And, the the record struct will be same as given > in "syscalls/sys_enter_open/format" .? > > Thanks > > On 31 March 2015 at 20:40, sahil aggarwal wrote: >> Yeah that was clear enough. >> Thanks a lot. Your code is of great help. >> >> Regards >> Sahil >> >> On 31 March 2015 at 19:45, Elazar Leibovich >> wrote: >>> I wanted to ensure the user always see contiguous array of data from >>> the ring buffer. >>> >>> The last piece of data, say "abcde" could wrap around in the ring >>> buffer and appear like: >>> >>> [de... ...abc] >>> >>> I wanted the user to see a contigious array of the form [abcde]. >>> >>> So in the case I'm having input that wrap around, I'll simply copy it >>> to the first buffer >>> >>> [wrap_buffer][de.. ...abc] >>> would become >>> [ abc][de... ...abc] >>> >>> And then I'll the user pointer to the leftmost "a", and he'll see >>> "abcde" without knowing he's handling a ring buffer. >>> >>> Let me know if I was clear enough. >>> >>> On Tue, Mar 31, 2015 at 2:18 PM, sahil aggarwal wrote: >>>> >>>> Hi Elazar >>>> >>>> Can you help me understand why you have used >>>> mmap_pages->wrap_base.? And, instead of allocating >>>> (2^n)+1 pages you allocate (2^n)+2 pages, why so.? >>>> wrap_base points to (2^n)+2 pages and base points to >>>> (2^n)+1 pages, what is use of wrap_base.? I tried reading >>>> perf source too, there it seems they use (2^n)+1 pages only. >>>> >>>> >>>> Thanks >>>> Regards > -- > To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html