From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A2D4DA0547; Wed, 12 Oct 2022 09:48:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A2CF42D86; Wed, 12 Oct 2022 09:48:23 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id BEC0F42BF0 for ; Wed, 12 Oct 2022 09:48:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665560901; 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=XpQrAQ8aH5f3gK9U2kDO91XEF8rqNvUd2uepknclwxg=; b=hOFqaC7DhFmBtjAEj4X2vEpwMn3RGVGWEELLthDoN9/f9FXOP3XvMHLjISjcHuwGgwopBq sLiOF8QHltSmuEpfi+2DOkAcuW9GhoMtoRPsuzlxnhcxi8ETCfkGzKglnLCd8GS/yBGbTC Cvw2foKZnq89YFMsLFnVojIN3NKsMRE= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-649-jlXyTN47OZ2eV3cDCYTxoQ-1; Wed, 12 Oct 2022 03:48:20 -0400 X-MC-Unique: jlXyTN47OZ2eV3cDCYTxoQ-1 Received: by mail-pl1-f199.google.com with SMTP id a17-20020a170902ecd100b0018463d1748dso988305plh.12 for ; Wed, 12 Oct 2022 00:48:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=XpQrAQ8aH5f3gK9U2kDO91XEF8rqNvUd2uepknclwxg=; b=lUKhKpKgVt4EIKcaRLkAbGlizdSogStwpXo5FUZt/wkusodmYL6IjNoe33baZO3SJE G6cnx4ZTV+E/N1U9S9EgulFOMaRXHRprh+BUQH1IXLp3A/lSKp9S0DZfw0GjYbEbEFT0 55rIggf0WhruhiWDbeWjQXOlhzfJz6lBkHUGDzSE3Ft3kv5wTdMZwKjww7KllRU3NIx/ e2+Kin4elt0vg3WjzDwjzjcCwLyzec1T5JA2KmbAKHG3kSf31UCy863L+YsUNzT6s+zu kCJ8/HJ85HecJbPBasvDhjlLV5dXB/6nOlwCTxiH1e2N4e3nBwWGZuHl8d28JwyKfg6t G6Aw== X-Gm-Message-State: ACrzQf1jgtBCeNFNjBttV3h/FZL7IAGwl7NkYSJtWONh6dmo0hpFoH/G 4Xf794OJX1O7o/tuFEC11c87a2txIvy6L76YG1LjVq3qlEJQK88g/8SeKT2d/zVNWp62VFjKWei swD6gt04u/X/qFJEf3zM= X-Received: by 2002:a17:90b:1c8e:b0:205:783b:fe32 with SMTP id oo14-20020a17090b1c8e00b00205783bfe32mr3738170pjb.39.1665560899370; Wed, 12 Oct 2022 00:48:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70cuyTopEY3TBzzBmu6xEvFcB4UaTU6BVd1N0289vA29/0GnDhtHO6oMSd9yVTT6qybrr2PxHkNCM8sITRAN8= X-Received: by 2002:a17:90b:1c8e:b0:205:783b:fe32 with SMTP id oo14-20020a17090b1c8e00b00205783bfe32mr3738151pjb.39.1665560899088; Wed, 12 Oct 2022 00:48:19 -0700 (PDT) MIME-Version: 1.0 References: <20220921120359.2201131-1-david.marchand@redhat.com> <20220921120359.2201131-8-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Wed, 12 Oct 2022 09:48:07 +0200 Message-ID: Subject: Re: [PATCH 7/8] trace: remove limitation on trace point name To: Jerin Jacob Cc: dev@dpdk.org, Jerin Jacob , Sunil Kumar Kori X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Oct 11, 2022 at 4:49 PM Jerin Jacob wrote: > > On Wed, Sep 21, 2022 at 5:35 PM David Marchand > wrote: > > > > The name of a trace point is provided as a constant string via the > > RTE_TRACE_POINT_REGISTER macro. > > We can rely on the constant string in the binary and simply point at it. > > I am not sure about this. If we compile with -Os (optimized for space) > compiler may decide to use stack instead of rodata. > If so, we will have segfaults with specific compiler or compiler build options. > Thoughts? Good point. We need an explicit storage for the string. What do you think of: @@ -20,9 +20,10 @@ RTE_DECLARE_PER_LCORE(volatile int, trace_point_sz); #define RTE_TRACE_POINT_REGISTER(trace, name) \ rte_trace_point_t __attribute__((section("__rte_trace_point"))) __##trace; \ +static const char __##trace##_name[] = RTE_STR(name); \ RTE_INIT(trace##_init) \ { \ - __rte_trace_point_register(&__##trace, RTE_STR(name), \ + __rte_trace_point_register(&__##trace, __##trace##_name, \ (void (*)(void)) trace); \ } -- David Marchand