Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp355279lqs; Tue, 5 Mar 2024 04:20:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWanScO66jrt1FAGocSaCro5un4+X4pPclii2+Yw828n1K1ebpYK8K6Xze202rSs6ZKy1pbYOqIJtZOoyMW32NqnV1VUGbsHPKuMEk7ig== X-Google-Smtp-Source: AGHT+IGukI6gK27TSHpNYxM/IOx1j4pMbmZKKE6gs1x6GDAB8fJ0KXPoF7UjuKladm0TaIOY4L/W X-Received: by 2002:a0c:e2c2:0:b0:690:77b9:a415 with SMTP id t2-20020a0ce2c2000000b0069077b9a415mr1869362qvl.50.1709641240773; Tue, 05 Mar 2024 04:20:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709641240; cv=pass; d=google.com; s=arc-20160816; b=my8ClYkL8NEDkY3TApLgmONoDGYqxo0OPYxNPFUl4QpmYhpa3NwmyVBryeRxrj+m3Y ILoaCYT+4AvfxFcJeQHeX2wyK/t4mGhqPZHdBKp3mmBJeKlT5dHw/BmFA8oGXUL2Krws wQr+DgYqdJKfCRAM8AT8upzmg+BrX7V1U+y/sSh10xwB4zQ01EWMrdbeZFQCW+y+v3KE Y+xNaF48++4BsjPgIpjnhYL7KOnHVn5gIX4Dk9JHdYWZl2VmRozYWu7wP5f621S2dsv6 yX9WsBthteaP8DR5PfY/8GG3g360q07VVe/n1EYqjgu/ymmt+zxtsZZRDYqBnlFQz18I eXSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=k6MJqDSK17Bt7iFrShSuYWu1nqQzBPtMXqrOhyVhVMk=; fh=mzP25rL236Tp7a3Ps6/6PoyBtBCMxNOzm4moGQaxjxc=; b=WFRVuFM7boXPwbVsG0eY0ReBcqGrHgpCQdt66ygiIVHlSZGm2uiX6boOjylFBqcvpf nkk4/LmxgfVZMJ25DT2qjU7qdgPd8KbnJmruBYUBK064r1s4HLxKkFp4fRu+lW6f85JY zjj2zlgNKD98XDTb+5z4w3RNWPlPC6fD+zKRPdnQnM33p7Xz/4r6Znu9OmebDG9Jr4r/ JwPu7bxiTv7tKqyIaBUIREh9WsBZ3aL+G5Akrgw0+7aWzpNr71SG5nP5C74wTRymlYX4 16k6NgKlVEyHBbjLEG+FSEuWVBxzycOLbJYUgiVOnsGyXAFoqtMswpZfT+Fb4COr8Mm9 E1XQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=andestech.com dmarc=pass fromdomain=andestech.com); spf=pass (google.com: domain of linux-kernel+bounces-92351-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92351-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=andestech.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ke24-20020a056214301800b0068fc7e637d2si12052110qvb.264.2024.03.05.04.20.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 04:20:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92351-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=andestech.com dmarc=pass fromdomain=andestech.com); spf=pass (google.com: domain of linux-kernel+bounces-92351-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92351-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=andestech.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 812011C233FE for ; Tue, 5 Mar 2024 12:20:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4EB85A7B4; Tue, 5 Mar 2024 12:20:25 +0000 (UTC) Received: from Atcsqr.andestech.com (60-248-80-70.hinet-ip.hinet.net [60.248.80.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C35B459B5E for ; Tue, 5 Mar 2024 12:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.248.80.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709641225; cv=none; b=ndF5DLRsSx2vpiTg6f3vazwLwP4YHeGhiSs+YJkDQxkYxrYOjLwvqjhsqzdHWzO5+etWGGDAc0Hj1auo7kvyfq/w9opuWeyg041j/Gp9QB6I5FSjlkKM+b5GWtImuUBvERN68+hzw7Yee1vgZaanNY8FrKduEXSj5zG8a1jTEbM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709641225; c=relaxed/simple; bh=gzqSxF3J4/X2VZKljyICmd3WC2eIxG/K3MMXzIEXafQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rjHT9YboLNLkD4hYoO09cKp9iED8byvUaT8ryRPkEb5FCC3MZz1sWoKV/OA1avArpC/zFClt+UHHZxR1ORSgBr6thsEbJ92YP3TiiF/UiAg/hzY5mXT/xgrm0SS0LWAcs1a54/Z51pbSnBlUFyGER2HZACnB0ukIyndqO6LuGQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=andestech.com; spf=pass smtp.mailfrom=andestech.com; arc=none smtp.client-ip=60.248.80.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=andestech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=andestech.com Received: from Atcsqr.andestech.com (localhost [127.0.0.2] (may be forged)) by Atcsqr.andestech.com with ESMTP id 425C5t73023911 for ; Tue, 5 Mar 2024 20:05:55 +0800 (+08) (envelope-from ben717@andestech.com) Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 425C5fPc023278; Tue, 5 Mar 2024 20:05:41 +0800 (+08) (envelope-from ben717@andestech.com) Received: from atctrx.andestech.com (10.0.15.173) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Tue, 5 Mar 2024 20:05:37 +0800 From: Ben Zong-You Xie To: , , , , , , , , , , , , , , CC: , , Ben Zong-You Xie Subject: [PATCH 1/2] perf daemon: Fix the warning about time_t Date: Tue, 5 Mar 2024 20:05:00 +0800 Message-ID: <20240305120501.1785084-2-ben717@andestech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305120501.1785084-1-ben717@andestech.com> References: <20240305120501.1785084-1-ben717@andestech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL:Atcsqr.andestech.com 425C5t73023911 In the 32-bit platform, the size of time_t is still 64 bits. Thus, use PRIu64 to resolve the format problem. Signed-off-by: Ben Zong-You Xie --- tools/perf/builtin-daemon.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-daemon.c b/tools/perf/builtin-daemon.c index 83954af36753..0b6ffd51c475 100644 --- a/tools/perf/builtin-daemon.c +++ b/tools/perf/builtin-daemon.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "builtin.h" #include "perf.h" #include "debug.h" @@ -688,7 +689,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out) /* lock */ csv_sep, daemon->base, "lock"); - fprintf(out, "%c%lu", + fprintf(out, "%c%" PRIu64 "", /* session up time */ csv_sep, (curr - daemon->start) / 60); @@ -700,7 +701,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out) daemon->base, SESSION_OUTPUT); fprintf(out, " lock: %s/lock\n", daemon->base); - fprintf(out, " up: %lu minutes\n", + fprintf(out, " up: %" PRIu64 " minutes\n", (curr - daemon->start) / 60); } } @@ -727,7 +728,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out) /* session ack */ csv_sep, session->base, SESSION_ACK); - fprintf(out, "%c%lu", + fprintf(out, "%c%" PRIu64 "", /* session up time */ csv_sep, (curr - session->start) / 60); @@ -745,7 +746,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out) session->base, SESSION_CONTROL); fprintf(out, " ack: %s/%s\n", session->base, SESSION_ACK); - fprintf(out, " up: %lu minutes\n", + fprintf(out, " up: %" PRIu64 " minutes\n", (curr - session->start) / 60); } } -- 2.34.1