From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 420FC6EC58; Mon, 22 Feb 2021 21:20:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 420FC6EC58 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614018037; bh=SmYt0wmSAYXpbxWcn3sLJeDrDWpg8XnMpbvIr4xICN8=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=HvB3D/vU06Q1v09IzHOH1GJm3mhKY1EA7PvNcpVQZ8cjy2NOyOvLzAlpaiFnsfTkh oA3nBMb9Y1wMORdD+3edQa9n45XUAP9/bjgL5vqPLUzeJ8GV31+M5xGbDZu6u+b6f3 mzh1zX4Hs9UZM4N4vja9JjX9QOt0t1wPxg3YVR5k= Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3A7536EC58 for ; Mon, 22 Feb 2021 21:20:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3A7536EC58 Received: by mail-lj1-f172.google.com with SMTP id o16so55429199ljj.11 for ; Mon, 22 Feb 2021 10:20:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=x0+T7j+rYQN1OmQMCGUDLnhvbo7zO9U6I0xjWmhxltk=; b=BidQcOADSRMzr/v86oqLs/5pBNn+kuBjwvz9K+AgGUSc2oQIfiVZg1btMqdznKU9zu hJBJrhfxoAYgfS+HSyePmnbdytzf854+AOyVi7zulVAgQnevaH39ClKBGshilAWKBya8 8u08M21ntF/z+9VlTyxV75vELh3oS3WJ6a5sc1ImGUS73Sf2ttDsS3fWyCVBkQRwHuOn 23W+3SeZWqrmf2t6LQrSkBCHvzveIpKViu0V/Hsod98KFPlCxBobnnIBczkgiQuMdbj1 3xg2O3R3k3wmLjkIuG2cIrYMceiZHqaJIskEVFnNTZlWIWhm6cn0hJKAUDdNhVJCD46J AR6A== X-Gm-Message-State: AOAM530FN3i+GYHDXpM48nT9oIcOf+ZOWWRzwPuGU7LxCDidM2s71Yyd 8tHkyl9vbeWWgEzmpL3RW7QnI1U7PHSNaQ== X-Google-Smtp-Source: ABdhPJyBzNNbwPN+PPKadEbAiQVTlgbyqA8L4YLh362YYBIJ7PZWZduJ4+vAe1F9G+QO89FA4yl5Fw== X-Received: by 2002:a2e:9f41:: with SMTP id v1mr9113392ljk.224.1614018033892; Mon, 22 Feb 2021 10:20:33 -0800 (PST) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id d21sm418284lfl.309.2021.02.22.10.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Feb 2021 10:20:32 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id D60DD56016D; Mon, 22 Feb 2021 21:20:31 +0300 (MSK) To: tml Date: Mon, 22 Feb 2021 21:20:30 +0300 Message-Id: <20210222182030.76232-1-gorcunov@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] say: fix format for fiber()->fid X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" The fiber's ID (fiber::fid) is unsigned integer so we should use a proper format specificator when printing it out, otherwise the logger show us weird strings like | main/-244760339/cartridge.failover.task I> Instance state changed Fixes #5846 Signed-off-by: Cyrill Gorcunov --- src/lib/core/say.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/core/say.c b/src/lib/core/say.c index cbd10e107..6138752a7 100644 --- a/src/lib/core/say.c +++ b/src/lib/core/say.c @@ -792,7 +792,7 @@ say_format_plain_tail(char *buf, int len, int level, const char *filename, if (cord) { SNPRINT(total, snprintf, buf, len, " %s", cord->name); if (fiber() && fiber()->fid != FIBER_ID_SCHED) { - SNPRINT(total, snprintf, buf, len, "/%i/%s", + SNPRINT(total, snprintf, buf, len, "/%u/%s", fiber()->fid, fiber_name(fiber())); } } @@ -918,7 +918,7 @@ say_format_json(struct log *log, char *buf, int len, int level, const char *file SNPRINT(total, snprintf, buf, len, "\""); if (fiber() && fiber()->fid != FIBER_ID_SCHED) { SNPRINT(total, snprintf, buf, len, - ", \"fiber_id\": %i, ", fiber()->fid); + ", \"fiber_id\": %u, ", fiber()->fid); SNPRINT(total, snprintf, buf, len, "\"fiber_name\": \""); SNPRINT(total, json_escape, buf, len, base-commit: 6610bce9bf43a139043518cd76d3c0c81c981ce2 -- 2.29.2