* Re: [PATCH] docs: translations: pt_BR: translate cpu-load.rst
2026-10-13 12:58 [PATCH] docs: translations: pt_BR: translate cpu-load.rst Efraim E. Vander
@ 2026-10-13 14:40 ` Daniel Pereira
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Pereira @ 2026-10-13 14:40 UTC (permalink / raw)
To: Efraim E. Vander
Cc: Jonathan Corbet, Shuah Khan, Randy Dunlap, linux-doc,
linux-kernel, Efraim E . Vander
On Tue, Oct 13, 2026 at 09:59, Efraim E. Vander
<efraimvander64@gmail.com> wrote:
>
> Translate cpu-load.rst into Brazilian Portuguese and
> add it to the pt_BR admin-guide documentation index.
The patch doesn't change pt_BR/admin-guide/index.rst. To be added to
the index, cpu-load should be moved from the "Todolist" to the toctree,
next to README and devices.
> Assisted-by: LLM
>
> Signed-off-by: Efraim E. Vander <efraimvander64@gmail.com>
Please keep both tags together, without a blank line between them.
> ---
> .../pt_BR/admin-guide/cpu-load.rst | 126 +++++++++---------
> 1 file changed, 65 insertions(+), 61 deletions(-)
>
> diff --git a/Documentation/translations/pt_BR/admin-guide/cpu-load.rst b/Documentation/translations/pt_BR/admin-guide/cpu-load.rst
> index 0c76acabe..f0bb48e82 100644
> --- a/Documentation/translations/pt_BR/admin-guide/cpu-load.rst
> +++ b/Documentation/translations/pt_BR/admin-guide/cpu-load.rst
This patch doesn't apply to docs-next. pt_BR/admin-guide/cpu-load.rst
doesn't exist in the tree yet, but the patch modifies it instead of
creating it. That's why it has removed lines: it seems it was generated
from a second local commit on top of a first draft, so the "-" lines
refer to text that only exists in your tree.
Please squash your commits (or generate the patch against docs-next),
so that the file is created from scratch ("new file mode",
"--- /dev/null", only "+" lines).
> +O Linux exporta diversas informações por meio de `/proc/stat` e `/proc/uptime`, que ferramentas do espaço do usuário (*userland*), como `top(1)`, utilizam para calcular o tempo médio que o sistema passou em determinado estado, por exemplo::
The original uses ``/proc/stat`` and ``/proc/uptime`` (double
backquotes, rendered as literals). With single backquotes they become
interpreted text and render differently. The same applies to the other
occurrences in the file.
Also, please wrap the lines as in the original document, instead of
keeping each paragraph in a single line.
> +É possível imaginar muitas outras situações em que esse comportamento do kernel pode gerar informações bastante inconsistentes em `/proc/stat`:
>
>
> + /* gcc -o hog smallhog.c */
> + #include <time.h>
The original ends this sentence with "::", which starts the literal
block. With a single ":", the program below is rendered as a block
quote, not as code.
Also, please keep the example program exactly as in the original
(indented with tabs, same formatting). It is code, so it shouldn't be
changed by the translation.
Before sending a v2, please apply it with "git am" on top of docs-next
and check the result with "make htmldocs".
Thanks,
Daniel
Em ter., 13 de out. de 2026 às 09:59, Efraim E. Vander
<efraimvander64@gmail.com> escreveu:
>
> Translate cpu-load.rst into Brazilian Portuguese and
> add it to the pt_BR admin-guide documentation index.
>
> Assisted-by: LLM
>
> Signed-off-by: Efraim E. Vander <efraimvander64@gmail.com>
> ---
> .../pt_BR/admin-guide/cpu-load.rst | 126 +++++++++---------
> 1 file changed, 65 insertions(+), 61 deletions(-)
>
> diff --git a/Documentation/translations/pt_BR/admin-guide/cpu-load.rst b/Documentation/translations/pt_BR/admin-guide/cpu-load.rst
> index 0c76acabe..f0bb48e82 100644
> --- a/Documentation/translations/pt_BR/admin-guide/cpu-load.rst
> +++ b/Documentation/translations/pt_BR/admin-guide/cpu-load.rst
> @@ -1,27 +1,26 @@
> -
> -
> .. SPDX-License-Identifier: GPL-2.0
>
> =============
> Carga da CPU
> =============
> -O Linux exporta diversas informações por meio de `/proc/stat` e `/proc/uptime`, que ferramentas do espaço do usuário (*userland*), como `top(1)`, utilizam para calcular o tempo médio que o sistema passou em determinado estado. Por exemplo:
> -
>
> -$ iostat
> -Linux 2.6.18.3-exp (linmac) 02/20/2007
> +O Linux exporta diversas informações por meio de `/proc/stat` e `/proc/uptime`, que ferramentas do espaço do usuário (*userland*), como `top(1)`, utilizam para calcular o tempo médio que o sistema passou em determinado estado, por exemplo::
>
> -avg-cpu: %user %nice %system %iowait %steal %idle
> - 10.01 0.00 2.92 5.44 0.00 81.63
> + $ iostat
> + Linux 2.6.18.3-exp (linmac) 02/20/2007
>
> + avg-cpu: %user %nice %system %iowait %steal %idle
> + 10.01 0.00 2.92 5.44 0.00 81.63
>
> -Nesse caso, o sistema considera que, durante o período de amostragem padrão, passou 10,01% do tempo executando tarefas no espaço do usuário, 2,92% no kernel e permaneceu ocioso durante 81,63% do tempo total.
> +Nesse caso, o sistema considera que, durante o período de amostragem padrão, passou 10,01% do tempo executando tarefas no espaço do usuário, 2,92% no kernel e permaneceu ocioso durante 81,63% do tempo.
>
> -Na maioria dos casos, as informações de `/proc/stat` refletem a realidade com bastante precisão. No entanto, devido à natureza da forma como e do momento em que o kernel coleta esses dados, às vezes essas informações não são confiáveis.
> +Na maioria dos casos, as informações de `/proc/stat` refletem a realidade com bastante precisão. No entanto, devido à natureza da forma como e do momento em que os dados são coletados, esses valores podem apresentar imprecisões.
>
> Então, como essas informações são coletadas?
> -Sempre que uma interrupção do temporizador (*timer interrupt*) é sinalizada, o kernel verifica que tipo de tarefa estava em execução naquele instante e incrementa o contador correspondente ao tipo ou estado dessa tarefa.
> -O problema é que o sistema pode ter alternado entre vários estados diversas vezes entre duas interrupções do temporizador. Ainda assim, o contador é incrementado apenas para o último estado observado.
> +
> +Sempre que uma interrupção do temporizador (*timer interrupt*) é sinalizada, o kernel verifica que tipo de tarefa estava em execução naquele instante e incrementa o contador correspondente.
> +
> +O problema é que o sistema pode ter alternado entre vários estados diversas vezes entre duas interrupções do temporizador. Ainda assim, o contador é incrementado apenas uma vez, de acordo com o estado observado no instante da interrupção.
>
> Exemplo
> -------
> @@ -35,67 +34,72 @@ Imagine um sistema com uma única tarefa que, periodicamente, consome ciclos de
> |_ algo começa a trabalhar |_ algo entra em suspensão
> (mas é despertado pouco depois)
>
> -
> -Na situação acima, de acordo com `/proc/stat`, a carga do sistema será de 0%, pois a interrupção do temporizador sempre ocorrerá quando o sistema estiver executando o tratador de ociosidade (*idle handler*).
> +Na situação acima, de acordo com `/proc/stat`, a carga do sistema será de 0%, pois a interrupção do temporizador sempre ocorrerá quando o sistema estiver executando a tarefa ociosa.
>
> Na realidade, porém, a carga estará mais próxima de 99%.
>
> É possível imaginar muitas outras situações em que esse comportamento do kernel pode gerar informações bastante inconsistentes em `/proc/stat`:
>
>
> - /* gcc -o hog smallhog.c */
> -
> - #include <time.h>
> - #include <limits.h>
> - #include <signal.h>
> - #include <sys/time.h>
> - #define HIST 10
>
> - static volatile sig_atomic_t stop;
> + /* gcc -o hog smallhog.c */
> + #include <time.h>
> + #include <limits.h>
> + #include <signal.h>
> + #include <sys/time.h>
>
> - static void sighandler(int signr)
> - {
> - (void) signr;
> - stop = 1;
> - }
> + #define HIST 10
>
> - static unsigned long hog (unsigned long niters)
> - {
> - stop = 0;
> - while (!stop && --niters);
> - return niters;
> - }
> + static volatile sig_atomic_t stop;
>
> - int main (void)
> - {
> - int i;
> - struct itimerval it = {
> - .it_interval = { .tv_sec = 0, .tv_usec = 1 },
> - .it_value = { .tv_sec = 0, .tv_usec = 1 } };
> - sigset_t set;
> - unsigned long v[HIST];
> - double tmp = 0.0;
> - unsigned long n;
> - signal(SIGALRM, &sighandler);
> - setitimer(ITIMER_REAL, &it, NULL);
> -
> - hog (ULONG_MAX);
> - for (i = 0; i < HIST; ++i) v[i] = ULONG_MAX - hog(ULONG_MAX);
> - for (i = 0; i < HIST; ++i) tmp += v[i];
> - tmp /= HIST;
> - n = tmp - (tmp / 3.0);
> -
> - sigemptyset(&set);
> - sigaddset(&set, SIGALRM);
> -
> - for (;;) {
> - hog(n);
> - sigwait(&set, &i);
> - }
> - return 0;
> - }
> + static void sighandler(int signr)
> + {
> + (void) signr;
> + stop = 1;
> + }
>
> + static unsigned long hog(unsigned long niters)
> + {
> + stop = 0;
> + while (!stop && --niters);
> + return niters;
> + }
> +
> + int main(void)
> + {
> + int i;
> + struct itimerval it = {
> + .it_interval = { .tv_sec = 0, .tv_usec = 1 },
> + .it_value = { .tv_sec = 0, .tv_usec = 1 }
> + };
> + sigset_t set;
> + unsigned long v[HIST];
> + double tmp = 0.0;
> + unsigned long n;
> +
> + signal(SIGALRM, &sighandler);
> + setitimer(ITIMER_REAL, &it, NULL);
> +
> + hog(ULONG_MAX);
> + for (i = 0; i < HIST; ++i)
> + v[i] = ULONG_MAX - hog(ULONG_MAX);
> +
> + for (i = 0; i < HIST; ++i)
> + tmp += v[i];
> +
> + tmp /= HIST;
> + n = tmp - (tmp / 3.0);
> +
> + sigemptyset(&set);
> + sigaddset(&set, SIGALRM);
> +
> + for (;;) {
> + hog(n);
> + sigwait(&set, &i);
> + }
>
> + return 0;
> + }
>
> Referências
> -----------
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread