linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Bristot de Oliveira <bristot@kernel.org>
To: tglozar@redhat.com, rostedt@goodmis.org
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	jkacur@redhat.com, jwyatt@redhat.com
Subject: Re: [PATCH 3/5] rtla/timerlat: Add --disable-idle-states for top
Date: Fri, 21 Jun 2024 10:45:45 +0200	[thread overview]
Message-ID: <9e4f976d-277e-41b3-9f32-943b2e8ddebc@kernel.org> (raw)
In-Reply-To: <20240612145439.206990-4-tglozar@redhat.com>

On 6/12/24 16:54, tglozar@redhat.com wrote:
> @@ -550,6 +555,7 @@ static struct timerlat_top_params
>  			{"aa-only",		required_argument,	0, '5'},
>  			{"warm-up",		required_argument,	0, '6'},
>  			{"trace-buffer-size",	required_argument,	0, '7'},
> +			{"disable-idle-states",	no_argument,		0, '8'},

Can we add an argument with a state level to set?

>  			{0, 0, 0, 0}
>  		};
>  
> @@ -726,6 +732,9 @@ static struct timerlat_top_params
>  		case '7':
>  			params->buffer_size = get_llong_from_str(optarg);
>  			break;
> +		case '8':
> +			params->disable_idle_states = 1;
> +			break;
>  		default:
>  			timerlat_top_usage("Invalid option");
>  		}
> @@ -922,6 +931,7 @@ int timerlat_top_main(int argc, char *argv[])
>  	int return_value = 1;
>  	char *max_lat;
>  	int retval;
> +	int i;
>  
>  	params = timerlat_top_parse_args(argc, argv);
>  	if (!params)
> @@ -971,6 +981,21 @@ int timerlat_top_main(int argc, char *argv[])
>  		}
>  	}
>  
> +	if (params->disable_idle_states) {
> +		for (i = 0; i < sysconf(_SC_NPROCESSORS_CONF); i++) {
> +			if (params->cpus && !CPU_ISSET(i, &params->monitored_cpus))
> +				continue;
> +			if (save_cpu_idle_disable_state(i) < 0) {
> +				err_msg("Could not save cpu idle state.\n");
> +				goto out_free;
> +			}
> +			if (set_cpu_idle_disable_state(i, 1) < 0) {

and use the argument state here?                                    ^

-- Daniel


  reply	other threads:[~2024-06-21  8:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12 14:54 [PATCH 0/5] rtla: Support idle state disabling via libcpupower in timerlat tglozar
2024-06-12 14:54 ` [PATCH 1/5] rtla: Add dependency on libcpupower tglozar
2024-06-21  8:46   ` Daniel Bristot de Oliveira
2024-06-12 14:54 ` [PATCH 2/5] rtla/utils: Add idle state disabling via libcpupower tglozar
2024-06-21  8:46   ` Daniel Bristot de Oliveira
2024-06-12 14:54 ` [PATCH 3/5] rtla/timerlat: Add --disable-idle-states for top tglozar
2024-06-21  8:45   ` Daniel Bristot de Oliveira [this message]
2024-06-12 14:54 ` [PATCH 4/5] rtla/timerlat: Add --disable-idle-states for hist tglozar
2024-06-12 14:54 ` [PATCH 5/5] rtla: Documentation: Add --disable-idle-states tglozar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e4f976d-277e-41b3-9f32-943b2e8ddebc@kernel.org \
    --to=bristot@kernel.org \
    --cc=jkacur@redhat.com \
    --cc=jwyatt@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglozar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).