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 68085A00C3 for ; Fri, 14 Oct 2022 10:37:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6296042CD6; Fri, 14 Oct 2022 10:37:45 +0200 (CEST) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) by mails.dpdk.org (Postfix) with ESMTP id EBFCA410F2; Fri, 14 Oct 2022 10:37:42 +0200 (CEST) Received: by mail-qt1-f169.google.com with SMTP id c23so3237443qtw.8; Fri, 14 Oct 2022 01:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MxtCCW67g9Hm5QGrcUjN0yrqCtBrvpq+bZG6KGSNxWA=; b=fq2VxsvrwVy+PBG4j+MqPyhfvmKJmcWFWPV/f0Q5io3TlV8uUufoE0xW9N0dznoMPF 67e7kK4W6DQLe1dPBYFHWkyytrXHJFd9GEni9Ti0x//hL/AWeo7g750mJJMF1vbC6JGi sW+JDTdgZPUTOySGcljThGi764TRt06vzjLobRrLocTrHmetDCt9Pa7GgZcEMZsmTyZe x1i9F3v0uDE+3M4qDLObVW3lbV9LWHcYsONNUHRkI04vvCBdUvIgaX2e2EWgfRQZ6flp E87Bf9g2l8Pwm4fq3EJsHDGhmsYHha2hkNLlolMx1ZCZIPXoQ6CnOt3hIkIsLqusNGhX T0+A== 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=MxtCCW67g9Hm5QGrcUjN0yrqCtBrvpq+bZG6KGSNxWA=; b=EZLFU1JnEhxhyD4ZzdWH56rWs/b7P7j3gfwLoakwD/oFoFxoOx6C1ucqVC5RbKnQd/ sJdFtGc8LhMzlSy/3Vy1y/Z3Ag2PCD/fERqt+j6voH14nB/QpiBqLUSZVYVXvAsBH8or MNO/FiD5D5YypqpeUtee2zeHlMyj9v4yQ69NYGD2zzhA/WqaKZ4wwsjIx8P9PY+Fk7R5 u9MxLwN+IvKnZeRqT6zi1cAKJShnwMe4pAE2w8P27iG4pLZBaYb+F/0w8OiCW6VJftB6 kj3uP+pWErvhu5gfRB/FWbjVJjI058YznFZ7mLyBj6hd4ppAxvbQrO76dceDZ3op3vXB rqag== X-Gm-Message-State: ACrzQf1A0Vge4Joamcg2n5GPUmZPD9SBUpbOEpwTncwU33OV9XlLj/bE YecXYD0/VC5ImZhgyj9iKzXdpL8x6aqCLn/ngdw= X-Google-Smtp-Source: AMsMyM73AbCl+jU7XjT5YP+yQwq+zreOtsRgdSkdNWnKi19Jg2yXFYj9Uthl8vh+3Q2VT0qYEU1sOX7tPHiMBnndY7M= X-Received: by 2002:a05:622a:48d:b0:39c:b642:824d with SMTP id p13-20020a05622a048d00b0039cb642824dmr3191965qtx.109.1665736662280; Fri, 14 Oct 2022 01:37:42 -0700 (PDT) MIME-Version: 1.0 References: <20220921120359.2201131-1-david.marchand@redhat.com> <20221012123112.2951802-1-david.marchand@redhat.com> <20221012123112.2951802-6-david.marchand@redhat.com> In-Reply-To: From: Jerin Jacob Date: Fri, 14 Oct 2022 14:07:16 +0530 Message-ID: Subject: Re: [EXT] [PATCH v3 5/9] trace: fix dynamically enabling trace points To: David Marchand Cc: Harman Kalra , Jerin Jacob Kollanukkaran , Sunil Kumar Kori , "dev@dpdk.org" , "stable@dpdk.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Fri, Oct 14, 2022 at 1:49 PM David Marchand wrote: > > On Fri, Oct 14, 2022 at 6:27 AM Jerin Jacob wrote: > > > > On Fri, Oct 14, 2022 at 12:41 AM David Marchand > > wrote: > > > > > > On Thu, Oct 13, 2022 at 7:07 PM Harman Kalra wrote: > > > > > > > > > > With the whole traces fixes series applied first, then the new "trace: > > > > > take live traces via telemetry" patch applied, I can't reproduce your issue. > > > > > > > > > > > > > > > > > > Yes, you replicated the same scenario what I tried. > > > > Sorry, I realized that actually it's not an issue, traces generated after /trace/save are getting > > > > appended but in the same file (timestamped on /trace/save) on rte_eal_cleanup(). > > > > > > > > I assumed that trace dir generated with a timestamp will include all the trace points emitted > > > > before that timestamp. But in the above scenario same trace dir includes trace points emitted > > > > after this timestamp. I think this is bit confusing. Shall we add a logic where if already_done is > > > > set, rename the original trace dir to latest timestamp? > > > > > > Afaiu, the behavior before this series was the same. > > > An application calling rte_trace_save() would always save to a single directory. > > > One thing that changed though is that the directory is timestamped > > > with the time of the first call to rte_trace_save. > > > Before the seriesn the timestamp was based on the time when the trace > > > subsystem was initialised. > > > > > > > > > We can go with what you describe (which makes sense to me). > > > But I'd like to get a ack from traces maintainers before looking into it. > > > > IMO, We can remove "already_done" logic, whenever, rte_trace_save() > > called, it creates > > the directory of that timestamp and copies the trace buffers. Since we > > have "overwrite" and "discard" > > modes, it is better to not add "already_done" dogic in rte_trace_save(). > > Well, it's a bit more difficult than just removing already_done. > > Before my changes, the timestamp was decided and the directory created > once and for all at init. > On the other hand, every trace_mkdir() call resulted in a > trace_dir_update() call. > --> /trace/save > {"/trace/save": {"Status": "OK", "Path": > "/home/dmarchan/dpdk-traces/rte-2022-10-14-AM-08-39-37"}} > --> /trace/save > {"/trace/save": {"Status": "OK", "Path": > "/home/dmarchan/dpdk-traces/rte-2022-10-14-AM-08-39-37rte-2022-10-14-AM-08-39-38"}} > > I prototyped a change (which deserves a separate patch). > Testing it, there is still one corner case when calling > rte_trace_save() twice in the same minute: > --> /trace/save > {"/trace/save": {"Status": "OK", "Path": > "/home/dmarchan/dpdk-traces/rte-2022-10-14-AM-10-11-19"}} > --> /trace/save > {"/trace/save": {"Status": "KO", "Path": > "/home/dmarchan/dpdk-traces/rte-2022-10-14-AM-10-11-19"}} > > EAL: Trace dir: /home/dmarchan/dpdk-traces/rte-2022-10-14-AM-10-11-19 > EAL: trace_mkdir():321 mkdir > /home/dmarchan/dpdk-traces/rte-2022-10-14-AM-10-11-19 failed [File > exists] > > What do you suggest for this? Top of the tree has "seconds" in trace director creation[1]. That will make it unique in all practical cases. To make future proof: We could do either of 1)Even with the second, if a directory exists and wait for 1sec and do from trace_session_name_generate() 2)Add 2 or 3 digits in the name. Have a counter to make it unique if the directory exists. [1] rc = strftime(trace_dir + rc, TRACE_DIR_STR_LEN - rc, "%Y-%m-%d-%p-%I-%M-%S", tm_result); > > > -- > David Marchand >