Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4948229rdh; Wed, 29 Nov 2023 16:02:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFS6PXwD0RQ/+07lJVy2G/GWPXm9OLpNMGHuVRF/yzrlwPX86qC/Pl0r/INz3Hy3f+QxW/ X-Received: by 2002:a05:6870:5cc7:b0:1e9:ae68:fda1 with SMTP id et7-20020a0568705cc700b001e9ae68fda1mr25974422oab.1.1701302524063; Wed, 29 Nov 2023 16:02:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701302524; cv=none; d=google.com; s=arc-20160816; b=NeC/r93YWeenOV4FmGeE92u7n2nHkYiKfOjfx+pfDwFTuVz/AJ+vFRonQ2Z3B89f5L UQA98Pal3/VKMXTnTqrNq3j/MIhBIlC0bBh5sWv6vhA5r9ECgnikXYSUMKf5PgobePH7 kmUnXdxa1gt9f0DK+ynZYq3+QlZaaKq4j1BosFnyr5GfqIPKkROiI6nyaWG7ms8Ops5X WW/1igcMQy74uP3ILrFYBKW5Xr6rbN1v4GtVSP3HE0jJXkYnJ+YQrXc5qtxxxJMTtcDl 7jDQLLCrJtbZjo9fR9T9v8/4R26fGCd2ICHhq9dFx/FUJlUzIM0jrZhRSvo9PK+ORihV VAVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=8rNrz3XkQ4Qfagb6GM81ZKFI8IndD5bNRxv6xh3Rh/A=; fh=4Kgt7kDtVrIXe4cKNywMQAY7jLnutXL9uOkaTa5MrMg=; b=zg8FvGHP9kWBzf1Dxhy92/MLiGoZHT1bENRVV8zmytGo7jtcd22F/eys/WuqaVqsCU IpAUMYeXlKKI/HhF3ozDyugKVyna/ryFTP/gfofCSLIkOfTbqMIcovZiCQGJ80XBNGMr t8pxXkdGgFKukvKYdQDL9tgGYDvMtPL2uATTnGKRgiKPYDtL9Jz1cHH6ir6+KC9IoGs/ Q6/7Hc80LlYPN/gs+/c5wqrxclx9+qEmQlCeX+2LiByc6r6n5Jfda3oslOazOVQGXQXH CyTPl0lm1QvKxOHZLCxfIJ1oJUvYCZ+K015Sft9+nFLFvY7KOe8hRwtoOfF1iJ+Y/05B fGiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bh15-20020a056830380f00b006d811baa56bsi4665140otb.13.2023.11.29.16.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 16:02:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DE257803112E; Wed, 29 Nov 2023 16:02:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbjK3ABs convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 Nov 2023 19:01:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbjK3ABr (ORCPT ); Wed, 29 Nov 2023 19:01:47 -0500 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CACA412F; Wed, 29 Nov 2023 16:01:53 -0800 (PST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1d001e4cf7cso3710995ad.2; Wed, 29 Nov 2023 16:01:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701302513; x=1701907313; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W3As+H3ba0cBEdpLgXC4M2L7j366iPfI/nKdLUEgmlU=; b=nqFU+2O5JNxryODpf7vQd8jhR9Y6zIDDY2XSXLdwVAt4jaQnuWwNQBxL2klplqarVW TdwW8s3ekyM6YVTNwxyGZd4a4b0iqUEjDhlo08IUqL92X5W9mCEx1nDrylTRDOIWJmHP 59yfyTxRqTFVGGByHIVj38gQnGT1o1eA0m5a1TZrUt9CLa2HPwY2PzT1z/WyTBu0uiHr 7B9Ks+/mSQAjGuPYX2vN04rCzodaFAnkBzhtlD77AGNyxJPPXYtqTeuz/+/CwmICT4yp lCZmsKzHuIWDgj54l5t2Tk+DhIR7SnDcVFvPKJe3+CUD4znqd9ZIoRln/EJFdd5CRy8j Wiig== X-Gm-Message-State: AOJu0Yz/f8bRuoSa4CT/9/mSszO+k9KrkPsIwegz8Mil3Y4OdM9un+0a 8LnBaGzY4eWqPCBbgji8y/4elS+Hq2fitlC5RSxEVta2Uwc= X-Received: by 2002:a17:902:ee95:b0:1cc:6dd5:59e8 with SMTP id a21-20020a170902ee9500b001cc6dd559e8mr17932368pld.26.1701302513109; Wed, 29 Nov 2023 16:01:53 -0800 (PST) MIME-Version: 1.0 References: <20231128175441.721579-1-namhyung@kernel.org> <20231128175441.721579-7-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Wed, 29 Nov 2023 16:01:41 -0800 Message-ID: Subject: Re: [PATCH 6/8] perf annotate: Ensure init/exit for global options To: Ian Rogers Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 29 Nov 2023 16:02:02 -0800 (PST) On Tue, Nov 28, 2023 at 11:21 AM Ian Rogers wrote: > > On Tue, Nov 28, 2023 at 9:54 AM Namhyung Kim wrote: > > > > Now it only cares about the global options so it can just handle it > > without the argument. > > If annotate_opts were accessed by a function then you could > pthread_once the initialization on the first call to get > annotate_opts. Removing annotation_options__init/exit would remove > some potential for error. Currently all call sites (perf annotate, report and top) initialize the options and check if it has conflicting options before running the commands. So I'm not sure if it needs pthread_once() for that. Thanks, Namhyung