Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3609818pxb; Mon, 9 Nov 2020 16:18:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtfm8ouFTlNKfx7Ir2/ZrylJ6/LMuiUeqO0ipRIOa0ukiAsGyQNZ6GMk1WC59wsIDgO8wm X-Received: by 2002:a17:906:1f13:: with SMTP id w19mr17222417ejj.39.1604967503012; Mon, 09 Nov 2020 16:18:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604967503; cv=none; d=google.com; s=arc-20160816; b=IncdtsfOn0/apNesvlhsRURuyH+/BYzEmrFed2+hqeqExYgE7PoygsWymMV3o4sJXP MlDX3x01MjT6F1bxt+VZCQEba3LnDgjSaSVQqH93BP4nfcnDFiT19j/AgmdtFyRZE4yf LeTF9Ny3ZhilJ5Hrkfh7hxjmMH2XcpWzVJurrNz2rAQkJWidncODH67k9iHhoktAAsar j2RjBxJsyMPj7QZFuC8IR1w+1JJ7/IuGGqsj4PeNX7jk3U0UJELlbSRQ9KzACiVyljkL QrB3Ogq2Er5ZXkrKWrA7JWMW8YtEaSHEgyWHqmVfMDEHOIPZkeoqhv7XWhbpBiR/bvS/ ZDiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CJv0+NP1zw8VzJL3PKHO+qX/+1LnctrRFA8Fvvr1FOc=; b=MnFeqOObCkr2aj3+sQKW0E0pGR5RGg3CQcVAMUwOdOuwAl22zvcbtUXfjHHd+Em4sF ppfceU8eyQoEJYFqZiAxd5TQV9HrKq+ESKLNYwcTraXZ5Ny14ul+KolE6C3Fgi5spQE1 rxNrHgviworJI/J83HMlDq2PaOAce9IFfMrYuQ/hz3EvyeuamjHAXMKbgeDKO8CE1Edq 7E+AZaf7k/r0y5xj3dWT17fbhHAezAEyI0jHfNuH8VrjTMDOh0XJmP7kt5hCO3ag9Mwi 3u5DooM2Z60r+Qo8J3Szl+vU4pK+al/qTA4CFAgVPAthNuFyAEBv4Y73zQ8IlRvfgwR2 grhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MfT+4p4d; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi25si8318260ejb.21.2020.11.09.16.17.58; Mon, 09 Nov 2020 16:18:23 -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=@gmail.com header.s=20161025 header.b=MfT+4p4d; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729454AbgKJAPz (ORCPT + 99 others); Mon, 9 Nov 2020 19:15:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729243AbgKJAPz (ORCPT ); Mon, 9 Nov 2020 19:15:55 -0500 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11C37C0613CF for ; Mon, 9 Nov 2020 16:15:55 -0800 (PST) Received: by mail-lj1-x243.google.com with SMTP id 11so12625886ljf.2 for ; Mon, 09 Nov 2020 16:15:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CJv0+NP1zw8VzJL3PKHO+qX/+1LnctrRFA8Fvvr1FOc=; b=MfT+4p4dezjt9OFQyTVf2a4eVfbfN8g8QHFYnZW7RXsbl8+WpvewDEF395+hietKgz WIGAZ3a2eiXwlVryYMWrO/u+4vgG1DlI2fSVPmv0Q6JI7Yx7DSAgEOTwu0/bCsxP1tHn XO1OsCipfH6MUQRL483uGEozrPyvd8DPvM7Ao0SC+MauGWfLJ1nb0gDoDi6tVECRYJUY +Ku64+9CAXE4mxZ8CmFzLj4yuQUUWpB+MrDbS/UTPDQMBYus58LkPoS0e6s2b3JqQSZ3 RB/HnGVCCcIA11F1rjImWTQrSHyFd73LTktyPCnZ/WsMVFeRAYKjdk+lPu2wTOBRl3e4 9Kjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CJv0+NP1zw8VzJL3PKHO+qX/+1LnctrRFA8Fvvr1FOc=; b=DkY/28g+KpPJgb7BKmq4ZQZqJ+YSyrCk0AHAsK9y8Ctriqa4uDl+xCT4H5sBvL5YDM HLLuOXGpS9qQMrRihRTaY765kfvL5CyeFJklWinMbC5EU5Z02uBLpkf6ea08/JhK7tJ2 OH+G3Bhq2lTCSc1AxWyXJxFH2gKRV/d9QX0ID2rFr3cvVc9qx8jU/0Cz16qctDucNhSG CDFcoCwxsBcUS6gfZBhI291kUfMKKw9OQ3oidfET2WsRXAwEIXiNGwoNuCwrxBzSsSAX P9rzpToByJSj69caZiAat3g13nAfN+ZKS2k4nPdBZ8VDwaSlQgTB4kGkMM/Jv/mdrMDR OIFg== X-Gm-Message-State: AOAM5316+ubd3alqHVguVTT4LsfLO4JY0JiXdXkyJwhDd4a7Emmvbi9i Dthwk/6pXnfJNJPcma1HFN6lj2AXk/aLDfa318c= X-Received: by 2002:a05:651c:1205:: with SMTP id i5mr7716319lja.283.1604967353417; Mon, 09 Nov 2020 16:15:53 -0800 (PST) MIME-Version: 1.0 References: <20201109215415.400153-1-jolsa@kernel.org> <20201109215415.400153-3-jolsa@kernel.org> In-Reply-To: <20201109215415.400153-3-jolsa@kernel.org> From: Alexei Starovoitov Date: Mon, 9 Nov 2020 16:15:42 -0800 Message-ID: Subject: Re: [PATCH 02/24] bpf: Add build_id_parse_size function To: Jiri Olsa Cc: 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.