zsh-workers
 help / color / mirror / code / Atom feed
669260eee3334a9a551135100cb319d961272daa blob 2203 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
#compdef kdump

_kdump_pid() {
  local -a args pids
  local -A assoc_pids

  if (( $+opt_args[-f] )); then
    args=(-f $opt_args[-f])
  fi
  pids=(${${${(f)"$(_call_program kdump-pids kdump $args)"}:#($'\t'|       )*}## #})
  [[ $OSTYPE == netbsd* ]] && pids=(${pids/ ##[0-9]##/})
  pids=(${(u)${pids/ /:}%% *})
  for 1 in $pids; do
    local pid=${1%%:*} process=${1#*:}
    if (( $+assoc_pids[$pid] )); then
      assoc_pids[$pid]+=", $process"
    else
      assoc_pids[$pid]=$process
    fi
  done
  pids=()
  for pid procs in ${(kv)assoc_pids}; do
    pids+=($pid:$procs)
  done
  _describe -t kdump-pids 'kdump pid' pids
}

local args=(
  '-d[display numbers in decimal]'
  '-f+[use the specified file (- for stdin)]:dump file:_files'
  '-l[loop reading the trace file]'
  '-m+[maximum I/O bytes to display]:max data bytes:'
  '-n[supress ad hoc translations]'
  '-p+[show output only for the specified pid]: :_kdump_pid'
  '(-E    -T)-R[display relative timestamps]'
  '(-E -R   )-T[display absolute timestamps]'
  '-t[select which tracepoints to display]: :_ktrace_points'
)

case $OSTYPE; in
  freebsd*|netbsd*)
    args+=(
      '(-R -T)-E[display elapsed timestamps]'
    )
    ;|
  freebsd*|openbsd*)
    args+=(
      '-H[display thread identifiers]'
    )
    ;|
  dragonfly*)
    args+=(
      '(-c -R)-a[display full human readable output]'
      '-c[display the CPU the thread is running on]'
      '-j[use a fixed format output]'
    )
    ;;
  freebsd*)
    args+=(
      '-A[display description of the ABI of traced process]'
      '-r[symbolically display structure members]'
      '-S[display system call numbers]'
      '-s[suppress display of I/O data]'
    )
    ;;
  netbsd*)
    args+=(
      '-e[interpret system call maps using the specified emulation]:emulation:'
      '-N[suppress system call name translation]'
      '-X[Display GIO data in hex and ascii in groups of specified size]:size:(1 2 4 8 16)'
      '-x[Display GIO data in hex and ascii]
      '1:dump file:_files'
    )
    ;;
  openbsd*)
    args+=(
      # XXX handle -TR
      '-X[display I/O data in hex and ASCII]'
      '-x[display I/O data in hex]'
    )
    ;;
esac

_arguments -s -S -A '-*' : $args
debug log:

solving 669260eee ...
found 669260eee in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).