From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753573AbbCSPiH (ORCPT ); Thu, 19 Mar 2015 11:38:07 -0400 Received: from mail-ig0-f177.google.com ([209.85.213.177]:35032 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbbCSPiE (ORCPT ); Thu, 19 Mar 2015 11:38:04 -0400 Message-ID: <550AED5D.3010700@plumgrid.com> Date: Thu, 19 Mar 2015 08:38:05 -0700 From: Alexei Starovoitov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Steven Rostedt CC: Ingo Molnar , Namhyung Kim , Arnaldo Carvalho de Melo , Jiri Olsa , Masami Hiramatsu , "David S. Miller" , Daniel Borkmann , Peter Zijlstra , linux-api@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 tip 3/8] tracing: allow BPF programs to call bpf_ktime_get_ns() References: <1426542584-9406-1-git-send-email-ast@plumgrid.com> <1426542584-9406-4-git-send-email-ast@plumgrid.com> <20150319111124.38f53061@gandalf.local.home> In-Reply-To: <20150319111124.38f53061@gandalf.local.home> 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 On 3/19/15 8:11 AM, Steven Rostedt wrote: > On Mon, 16 Mar 2015 14:49:39 -0700 > Alexei Starovoitov wrote: > >> bpf_ktime_get_ns() is used by programs to compue time delta between events > > "compute" ok :) >> + [BPF_FUNC_ktime_get_ns] = { >> + .func = bpf_ktime_get_ns, >> + .gpl_only = true, >> + .ret_type = RET_INTEGER, > > Hmm, a nanosecond value returned as integer? Is there a way to make > this a 64 bit return type, or is RET_INTEGER default to 64 bits in BPF > functions? RET_INTEGER doesn't mean C 'int' width. It means non-pointer and non-void value. The return value is always promoted to full register width which is 64-bit.