Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3868870pxb; Tue, 10 Nov 2020 02:04:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqZNlkNXc+CSvemWtahgcML5p2ULpp43L5b2J7QK0IIdlQw4PdUDP1XwAOxaCKVs6IQwmc X-Received: by 2002:a05:6402:759:: with SMTP id p25mr20296290edy.22.1605002649958; Tue, 10 Nov 2020 02:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605002649; cv=none; d=google.com; s=arc-20160816; b=ATUBKufSnVOi5IKEL5hVbo0wITISvtZ+Yn3mBfai+DUC4h3Xb9hW9JZ6lPq2Z2HmDg QeXU0fj7SKfDS1NmW6mYlLTxxI8r1ZFLAfJnABtvW2/dWomgA/blbyRJQj/EzNGlgzw0 TC7RW+9f9VZ57o/Tvwvey2oowP2pWXJNKxRQ8PGSewAHDPMi8PxzG5iLvNcnHPJuTcym y6FxclVDG9U5sTs9QVY3WyaO2/dUz57OIArxIxkxVtkIHJt4YtPomyxrpI1+Vg46rOfk 40akvaLRIKvaE4CuU8sBEc4SYNJvLW70W3g2eAfmnHLhx3eC5OiLk1eIdcWXS59wwlej dcZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Q1ZG2YVszGjoyBGFui4k875AVjUELR1/C4e620On31o=; b=c+FmGUyMKugluW8cWPOPNudvr+Qx2+pMnAs0lcZtKD3fm86ZCzaeUOOoOIJnJLLeJX ZSg1B/dnuWmYKdGj1lDLw5KaBzxo9DJKRJMw5/SEILOjBeW5Ml3WTbOck2E2BNNkXAnh urbGDOiuwe6HOLowbbEMRUOO0ozddIXHyi26X7fG5IeAydOimRNBPqtN+1J/6wJwvrwP 9C+EJZC3eqcigAxzJV3PNMfoI4oKRD2lCZCnlHVh2EJSVnoFBreXgnHGCFmOYMcrO7z9 p6jYL1vB/7nThusUq8k8ENTlTj7TZDWBnBUO0Ak2CY4CzLkKUHr0qnjcF78Uhpv6GWS4 q+Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bEhso7Bc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz31si8333579ejb.484.2020.11.10.02.03.46; Tue, 10 Nov 2020 02:04:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bEhso7Bc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729604AbgKJKCK (ORCPT + 99 others); Tue, 10 Nov 2020 05:02:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58323 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbgKJKCI (ORCPT ); Tue, 10 Nov 2020 05:02:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605002526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Q1ZG2YVszGjoyBGFui4k875AVjUELR1/C4e620On31o=; b=bEhso7BcRcX7wcm4D2uDxqKdJpODTWcxES+SRdkl6frMoFHHvgieI3PX8/MqcLaZ6F2z5C jXFdd6ajD+SCsIIcl9G04MRwifuXptuT/ClqXu1s/BgycP2rrTjxZdCwF/HAJa71fpsNeq ESZPZY0Bltmb5Q7kn2LgBeX3K1JmyhA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-497-XJIZoZnlNA6vSmmpUjarAQ-1; Tue, 10 Nov 2020 05:02:04 -0500 X-MC-Unique: XJIZoZnlNA6vSmmpUjarAQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3674C5F9E2; Tue, 10 Nov 2020 10:02:02 +0000 (UTC) Received: from krava (unknown [10.40.195.135]) by smtp.corp.redhat.com (Postfix) with SMTP id 62C23389; Tue, 10 Nov 2020 10:01:58 +0000 (UTC) Date: Tue, 10 Nov 2020 11:01:57 +0100 From: Jiri Olsa To: Alexei Starovoitov Cc: Jiri Olsa , Arnaldo Carvalho de Melo , Alexei Starovoitov , Song Liu , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Ian Rogers , Stephane Eranian , Alexey Budankov , Andi Kleen , Adrian Hunter Subject: Re: [PATCH 02/24] bpf: Add build_id_parse_size function Message-ID: <20201110100157.GA387652@krava> References: <20201109215415.400153-1-jolsa@kernel.org> <20201109215415.400153-3-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 09, 2020 at 04:15:42PM -0800, Alexei Starovoitov wrote: > On Mon, Nov 9, 2020 at 1:54 PM Jiri Olsa wrote: > > > > It's possible to have other build id types (other than default > > SHA1). Currently there's also ld support for MD5 build id. > > > > Adding build_id_parse_size function, that returns also size of > > the parsed build id, so we can recognize the build id type. > > > > Cc: Alexei Starovoitov > > Cc: Song Liu > > Signed-off-by: Jiri Olsa > > --- > > include/linux/buildid.h | 2 ++ > > lib/buildid.c | 31 ++++++++++++++++++++++++------- > > 2 files changed, 26 insertions(+), 7 deletions(-) > > > > diff --git a/include/linux/buildid.h b/include/linux/buildid.h > > index 3be5b49719f1..edba89834b4c 100644 > > --- a/include/linux/buildid.h > > +++ b/include/linux/buildid.h > > @@ -7,5 +7,7 @@ > > #define BUILD_ID_SIZE 20 > > > > int build_id_parse(struct vm_area_struct *vma, unsigned char *build_id); > > +int build_id_parse_size(struct vm_area_struct *vma, unsigned char *build_id, > > + __u32 *size); > > I think it's too many choices for such trivial api. > Just keep one build_id_parse() with two outputs > and fix the callers. > ok, will do jirka