From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 966EB1F5AE for ; Tue, 11 May 2021 19:06:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232218AbhEKTHS (ORCPT ); Tue, 11 May 2021 15:07:18 -0400 Received: from siwi.pair.com ([209.68.5.199]:16066 "EHLO siwi.pair.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232256AbhEKTHL (ORCPT ); Tue, 11 May 2021 15:07:11 -0400 Received: from siwi.pair.com (localhost [127.0.0.1]) by siwi.pair.com (Postfix) with ESMTP id BBC263F4090; Tue, 11 May 2021 15:06:04 -0400 (EDT) Received: from jeffhost-mbp.local (162-238-212-202.lightspeed.rlghnc.sbcglobal.net [162.238.212.202]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by siwi.pair.com (Postfix) with ESMTPSA id 6BE403F4047; Tue, 11 May 2021 15:06:04 -0400 (EDT) Subject: Re: [PATCH v4 1/8] dir: convert trace calls to trace2 equivalents To: Elijah Newren via GitGitGadget , git@vger.kernel.org Cc: Eric Sunshine , Elijah Newren , Derrick Stolee , Jeff King , Philip Oakley , Jeff Hostetler , Josh Steadmon References: <9204e36b7e9035c4cdda018d7ced8e8ca7acc8bc.1620758049.git.gitgitgadget@gmail.com> From: Jeff Hostetler Message-ID: Date: Tue, 11 May 2021 15:06:03 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <9204e36b7e9035c4cdda018d7ced8e8ca7acc8bc.1620758049.git.gitgitgadget@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 5/11/21 2:34 PM, Elijah Newren via GitGitGadget wrote: > From: Elijah Newren > > Signed-off-by: Elijah Newren > --- > dir.c | 43 +++++-- > t/t7063-status-untracked-cache.sh | 205 ++++++++++++++++++------------ > t/t7519-status-fsmonitor.sh | 8 +- > 3 files changed, 155 insertions(+), 101 deletions(-) > > diff --git a/dir.c b/dir.c > index 3474e67e8f3c..122fcbffdf89 100644 > --- a/dir.c > +++ b/dir.c > @@ -2760,15 +2760,34 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d > return root; > } > > +static void trace2_read_directory_statistics(struct dir_struct *dir, > + struct repository *repo, > + const char *path) > +{ > + if (!dir->untracked) > + return; > + trace2_data_string("read_directory", repo, "path", path); I'm probably just nit-picking here, but should this look more like: if (path && *path) trace2_data_string(...) if (!dir->untracked) return; Then when you add the visitied fields in the next commit, you'll have the path with them (when present). (and it would let you optionally avoid the tmp strbuf in the caller.) Jeff