Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp631957rdb; Sun, 18 Feb 2024 05:00:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUTUQsrtoE7apusod4Es8a/MTt3HHUFf2XzSFzrlzfc5PpiL6YzKxFK6d6gMWtOOY0o/McW8UrEO4rfzVVqcIQ+krDbkSTQ9UGNgjXDxA== X-Google-Smtp-Source: AGHT+IEGicEtMdYc179gQmh890OeZjJIeqRnHfDm+RQS7zL8GrCWDKwI/cgcZ8e6YKdkFW17tWvN X-Received: by 2002:a17:90b:288e:b0:299:277a:b10a with SMTP id qc14-20020a17090b288e00b00299277ab10amr6162115pjb.49.1708261251809; Sun, 18 Feb 2024 05:00:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708261251; cv=pass; d=google.com; s=arc-20160816; b=ob2kWier8nsgtgVwzm/YBpKeHW7e7nckZ1hB4oOyiELRjHm+41V/SusMcxwLIP6MdF Pu1gBdHed2OBPienrxwxOlGp7h5DSQjS/s4DrxqNUf5DdRlkpZDVVWPWsl1dpN4G97J2 e1H4eqI6XMnZ5jFlqTt7QwFvorDRL2Mr1Eb+mnzB6KfeZah8Cyt8oKBEkC421+yoy/Xn gXqwDmd/tsMFGvmS5oR1v6zpbcXxcb338h7zIgnrWg1nZ3Ykhw9sQ3QX7CZseUx8ImyB /3igrt6pY1VzX+FAlP08CVJGctil68HlmDto4rzwEZ3BOlP7XKwIY9+pqk20CUv/7go/ 3Qng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=RodByd/HG8871Mn03XNPX9N8h91R/e6bdUV6nucU/s0=; fh=luZrXHFamwPYxXTQhHIatcEiI7D+UxwJJYzmQPyT2OA=; b=UuPYzheugscAubbcTOjzaNcUjJFMsCA3Vys+6CPhbd+Sd1V5R2QM4dLeB7q1Tn0qRn TtuPNbALtgfElLA3xd5wzjFWAqQfTwfjL+XDPEYbCEfJAW+jaQGRU7+aoNjxlxgf/R2V wfgu5fHdPZd9VcgtG2eQ+iovAfTdoBqcKPR7WLJovkHbsvScTbcQPDi5vj8RTGvV3x9B eqNXTjd+xm3p/rM082bemSZqYHaobGr5xdrZCR/x1LSQvLhwUJM1+QJ4RSh8UJgWB2j9 dm0oQ8ovpJbrcjCxwnCJZoLWTVClnRKLqcoUch3vf+KCSVnahMo4yvstU9csQgz1109l sbOw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=jaeR2EcQ; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-70393-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70393-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f30-20020a63381e000000b005ca5616facesi2880281pga.38.2024.02.18.05.00.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 05:00:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70393-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=jaeR2EcQ; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-70393-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70393-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 83199281D63 for ; Sun, 18 Feb 2024 13:00:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CEFB96BFA2; Sun, 18 Feb 2024 13:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="jaeR2EcQ" Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06F814EB41 for ; Sun, 18 Feb 2024 13:00:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708261243; cv=none; b=YYNZb1yOXmTzR1dVuzXyn3d325pWwhUYo5IbGIjAWYUKPyZ2TO2gZx3ukCzox1OHzZOy2lGVwtTdCOuBfyC73HJ2HsWDlkVjfMvevr42kO8eOZiXTbya16W3bTjaWJRNvC0kbFsHTzcGFVWySs9gG6iTH2PyzMQZo6NiqcSMzPM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708261243; c=relaxed/simple; bh=8OEULQsbJfHqfkXaJy2htFuiEY9YhAYuhxxZlhozNTQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oZi7p1Zg93lMzcKzl4a2PXUcXojbSEz3V9+Zqdc8lwFpoZH8Iet/k7WoTDcNQkNRMA83RfNDqchELhCV0MRxVN0A4RKMBOMWkhcGwOMQxsq9mquZrCG9UOQPrFcA55xAGfjzXP2QjNk7GEPZwKDGkoGKxPSRdK+AhRmxew44/xg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=jaeR2EcQ; arc=none smtp.client-ip=209.85.216.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2866b15b013so993726a91.0 for ; Sun, 18 Feb 2024 05:00:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1708261240; x=1708866040; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RodByd/HG8871Mn03XNPX9N8h91R/e6bdUV6nucU/s0=; b=jaeR2EcQ0f5a9YEbXLM2S3PBeD6qUrOzBLPfLvJIyCrUKvJsRNPRAorn07isKcJaSk rEZtRHw/3E18xowGleJuM3z+sHblj0kAzRDBMfhoRQS0EIPpagv9pKhToYmX5zjuC0Sv Ulrx0cJosMpltzYOlmjJJ6cG7u88fzha6zCVG5/VJssUAHloSD51ggXN4t4CNVQCOaV2 d4DexksgWMvu+pwOwRdgTXEcig/nHtXixLgPBJGa8ZLOCl+3CKQeMLXhV3TUdBoaGd96 c2MyaKRnqAyDttrcLGFHI1SVrY3U2mJdrSjggoDLR8gGLAXc7F/lrmvZKyMsw4eWZWKZ 5Heg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708261240; x=1708866040; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RodByd/HG8871Mn03XNPX9N8h91R/e6bdUV6nucU/s0=; b=RDfGaPJeZuNw8z3C41uWrnkg2DR3G0ewt5+SDPRChxFvJKnIYoWtDNI0yc/pELTgu0 iXI50gBUrC8WUebMBoWoNMX7rFVM/SuQZapDLPdtitawzUiFtzN7kUaRvmljPdjlPjRh ATCiC8OVB7tcDvHe8+q+UPRb/3g4IryFBQTyzV8XIhV2HHuXJElTbzOyd+PueFMRy+6Y 6MRxZ6681mydiIl1cEBxYdU/3lG4gLivxVlFA96QBvdOKQOPQKCgOJW34xRfUY/xcO7u R4vzKQXqSt1Dm1yxQHebDxfdpgRTIkMYVS0uBeFatBebQBocexeD8ltzAkgOr/KCQbfb APuA== X-Forwarded-Encrypted: i=1; AJvYcCV7gYgY/DGZfastUCRwRSE1ayXA9of1NSe+iim55SHM0flOTU9yovgvxwW/qAzUu6RmMV8M53MamYJ/EmJpgMmXmeIQeBhrlNWWSJpF X-Gm-Message-State: AOJu0YyxMmODGlY0uNLuvH/PEAhtcGCqu3hrZ1Pv7TaTN2/XSGJ3oPUh WLZYtuV0lxvUEXg1Mhlo58SxEVGJXVOSr6RcCkLYDQaldwPNqA5WjxrW6DxAwfE= X-Received: by 2002:a05:6a21:999c:b0:1a0:9abd:2801 with SMTP id ve28-20020a056a21999c00b001a09abd2801mr3451853pzb.3.1708261239954; Sun, 18 Feb 2024 05:00:39 -0800 (PST) Received: from [192.168.1.150] ([198.8.77.194]) by smtp.gmail.com with ESMTPSA id 18-20020a631052000000b005d553239b16sm2906268pgq.20.2024.02.18.05.00.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Feb 2024 05:00:39 -0800 (PST) Message-ID: Date: Sun, 18 Feb 2024 06:00:38 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] liburing: add script for statistics sqpoll running time. Content-Language: en-US To: Xiaobing Li Cc: asml.silence@gmail.com, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, kun.dou@samsung.com, peiwei.li@samsung.com, joshi.k@samsung.com, kundan.kumar@samsung.com, wenwen.chen@samsung.com, ruyi.zhang@samsung.com References: <20240206024014.11412-1-xiaobing.li@samsung.com> <20240218055953.38903-1-xiaobing.li@samsung.com> From: Jens Axboe In-Reply-To: <20240218055953.38903-1-xiaobing.li@samsung.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/17/24 10:59 PM, Xiaobing Li wrote: > On 2/6/24 10:40 AM, Xiaobing Li wrote: >> diff --git a/test/sqtimeshow.sh b/test/sqtimeshow.sh >> new file mode 100644 >> index 0000000..e85fd2f >> --- /dev/null >> +++ b/test/sqtimeshow.sh >> @@ -0,0 +1,61 @@ >> +#!/usr/bin/env bash >> + >> +UPLINE=$(tput cuu1) >> + >> +function set_header() { >> + printf "\033[47;30m%-15s %-15s %-15s %-15s \033[0m\n" PID WorkTime\(us\) TotalTime\(us\) COMMAND >> +} >> + >> +function get_time() { >> + pid=$1 >> + item=$2 >> + proc_file="/proc/$pid/fdinfo/6" >> + if [ ! -e $proc_file ]; then >> + return >> + fi >> + content=$(cat ${proc_file} | grep ${item} | awk -F" " '{print $2}') >> + echo ${content%us} >> +} >> + >> +function show_util() { >> + index=0 >> + while true >> + do >> + data=$(top -H -b -n 1 | grep iou-sqp) >> + if [ -z "${data}" ]; then >> + echo "no sq thread is running." >> + exit >> + fi >> + index=0 >> + num=$(echo $data | tr -cd R |wc -c) >> + arr=($data) >> + len=$((${#arr[@]} / ${num})) >> + i=0 >> + while [ ${i} -lt ${num} ] >> + do >> + pid=${arr[${i} * ${len}]} >> + name=${arr[${i} * ${len} + len - 1]} >> + work_time=$(get_time $pid "SqWorkTime") >> + total_time=$(get_time $pid "SqTotalTime") >> + printf "%-15s %-15s %-15s %-15s\n" ${pid} ${work_time} ${total_time} ${name} >> + ((i++)) >> + done >> + sleep 2 >> + update=$UPLINE >> + for j in $(seq 1 ${num}); do >> + update=$update$UPLINE >> + done >> + if [ ! -z "$(top -H -b -n 1 | grep iou-sqp)" ]; then >> + echo "$update" >> + fi >> + done >> +} >> + >> +function main() { >> + # set header >> + set_header >> + # show util >> + show_util >> +} >> + >> +main > > Hi, Jens and Pavel > This patch is to add a script that displays the statistics of the > sqpoll thread to the terminal. No objections to this one, but it will not get applied until the kernel side is sorted out. -- Jens Axboe