"Fossies" - the Fresh Open Source Software Archive

Member "sysdig-0.26.1/userspace/sysdig/chisels/v_procs_cpu.lua" (24 May 2019, 3808 Bytes) of package /linux/misc/sysdig-0.26.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Lua source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 --[[
    2 Copyright (C) 2013-2018 Draios Inc dba Sysdig.
    3 
    4 This file is part of sysdig.
    5 
    6 Licensed under the Apache License, Version 2.0 (the "License");
    7 you may not use this file except in compliance with the License.
    8 You may obtain a copy of the License at
    9 
   10     http://www.apache.org/licenses/LICENSE-2.0
   11 
   12 Unless required by applicable law or agreed to in writing, software
   13 distributed under the License is distributed on an "AS IS" BASIS,
   14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15 See the License for the specific language governing permissions and
   16 limitations under the License.
   17 
   18 --]]
   19 
   20 view_info = 
   21 {
   22     id = "procs_cpu",
   23     name = "Processes CPU",
   24     description = "Show total versus user versus system CPU usage for every process.",
   25     tips = {
   26         "A high value for both SYS and SYSCALLS likely means that the process is I/O bound. A high value for SYS and a moderate value for SYSCALLS might on the other side indicate a kernel bottleneck. In both cases, drilling down with the 'System Calls' view can help understand what's happening."
   27     },
   28     tags = {"Default", "wsysdig"},
   29     view_type = "table",
   30     filter = "evt.type!=switch",
   31     applies_to = {"", "container.id", "fd.name", "fd.containername", "fd.sport", "fd.sproto", "evt.type", "fd.directory", "fd.containerdirectory", "fd.type", "k8s.pod.id", "k8s.rc.id", "k8s.rs.id", "k8s.svc.id", "k8s.ns.id", "marathon.app.id", "marathon.group.name", "mesos.task.id", "mesos.framework.name"},
   32     is_root = true,
   33     drilldown_target = "threads",
   34     use_defaults = true,
   35     columns = 
   36     {
   37         {
   38             name = "NA",
   39             field = "thread.tid",
   40             is_key = true
   41         },
   42         {
   43             name = "NA",
   44             field = "proc.pid",
   45             is_groupby_key = true
   46         },
   47         {
   48             name = "PID",
   49             description = "Process PID.",
   50             field = "proc.pid",
   51             colsize = 8,
   52         },
   53         {
   54             tags = {"containers"},
   55             name = "VPID",
   56             field = "proc.vpid",
   57             description = "PID that the process has inside the container.",
   58             colsize = 8,
   59         },
   60         {
   61             name = "TOT",
   62             field = "thread.cpu",
   63             description = "Total amount of CPU used by the proccess (user + system).",
   64             aggregation = "AVG",
   65             groupby_aggregation = "SUM",
   66             colsize = 8,
   67             is_sorting = true
   68         },
   69         {
   70             name = "USER",
   71             field = "thread.cpu.user",
   72             description = "Amount of user CPU used by the proccess.",
   73             aggregation = "AVG",
   74             groupby_aggregation = "SUM",
   75             colsize = 8,
   76         },
   77         {
   78             name = "SYS",
   79             field = "thread.cpu.system",
   80             description = "Amount of system CPU used by the proccess.",
   81             aggregation = "AVG",
   82             groupby_aggregation = "SUM",
   83             colsize = 8,
   84         },
   85         {
   86             name = "SYSCALLS",
   87             field = "evt.count",
   88             description = "Number of system calls per second made by the proccess.",
   89             aggregation = "TIME_AVG",
   90             groupby_aggregation = "SUM",
   91             colsize = 9,
   92         },
   93         {
   94             tags = {"containers"},
   95             name = "CONTAINER",
   96             description = "The container this process belongs to.",
   97             field = "container.name",
   98             colsize = 20
   99         },
  100         {
  101             name = "Command",
  102             description = "The full command line of the process.",
  103             field = "proc.exeline",
  104             aggregation = "MAX",
  105             colsize = 0
  106         }
  107     },
  108     actions = 
  109     {
  110         {
  111             hotkey = "9",
  112             command = "kill -9 %proc.pid",
  113             description = "kill -9",
  114             ask_confirmation = true,
  115             wait_finish = false
  116         },
  117         {
  118             hotkey = "c",
  119             command = "gcore %proc.pid",
  120             description = "generate core",
  121         },
  122         {
  123             hotkey = "g",
  124             command = "gdb -p %proc.pid",
  125             description = "gdb attach",
  126             wait_finish = false
  127         },
  128         {
  129             hotkey = "k",
  130             command = "kill %proc.pid",
  131             description = "kill",
  132             ask_confirmation = true,
  133             wait_finish = false
  134         },
  135         {
  136             hotkey = "l",
  137             command = "ltrace -p %proc.pid",
  138             description = "ltrace",
  139         },
  140         {
  141             hotkey = "s",
  142             command = "gdb -p %proc.pid --batch --quiet -ex \"thread apply all bt full\" -ex \"quit\"",
  143             description = "print stack",
  144         },
  145     },
  146 }