From: Timo Sirainen Date: Wed, 17 Mar 2021 13:15:00 +0000 (+0200) Subject: lib-storage: Add reason_code=mailbox:search X-Git-Tag: 2.3.18~328 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=87cd6570a14b3f572fc6000f710df409371a4bcb;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Add reason_code=mailbox:search --- diff --git a/src/lib-storage/index/index-search.c b/src/lib-storage/index/index-search.c index 929aa4b3fd..71dfc70152 100644 --- a/src/lib-storage/index/index-search.c +++ b/src/lib-storage/index/index-search.c @@ -1402,12 +1402,16 @@ static int search_match_once(struct index_search_context *ctx) { int ret; + /* Use search as the reason only while specifically matching the search + parameters, not while prefetching wanted_fields. */ + struct event_reason *reason = event_reason_begin("mailbox:search"); ret = mail_search_args_foreach(ctx->mail_ctx.args->args, search_cached_arg, ctx); if (ret < 0) ret = search_arg_match_text(ctx->mail_ctx.args->args, ctx); if (ret < 0) ret = index_search_mime_arg_match(ctx->mail_ctx.args->args, ctx); + event_reason_end(&reason); return ret; }