summaryrefslogtreecommitdiffstats
path: root/.gitignore
blob: d01cda8e11779a2fa3e3333fd176e2e77e02fd21 (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# SPDX-License-Identifier: GPL-2.0-only
#
# NOTE! Don't add files that are generated in specific
# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.
#
# NOTE! Please use 'git ls-files -i --exclude-standard'
# command after changing this file, to see if there are
# any tracked files which get ignored after the change.
#
# Normal rules (sorted alphabetically)
#
.*
*.a
*.asn1.[ch]
*.bin
*.bz2
*.c.[012]*.*
*.dt.yaml
*.dtb
*.dtb.S
*.dwo
*.elf
*.gcno
*.gz
*.i
*.ko
*.lex.c
*.ll
*.lst
*.lz4
*.lzma
*.lzo
*.mod
*.mod.c
*.o
*.o.*
*.patch
*.s
*.so
*.so.dbg
*.su
*.symtypes
*.tab.[ch]
*.tar
*.xz
*.zst
Module.symvers
modules.builtin
modules.order

#
# Top-level generic files
#
/tags
/TAGS
/linux
/vmlinux
/vmlinux.32
/vmlinux.symvers
/vmlinux-gdb.py
/vmlinuz
/System.map
/Module.markers
/modules.builtin.modinfo
/modules.nsdeps

#
# RPM spec file (make rpm-pkg)
#
/*.spec

#
# Debian directory (make deb-pkg)
#
/debian/

#
# Snap directory (make snap-pkg)
#
/snap/

#
# tar directory (make tar*-pkg)
#
/tar-install/

#
# We don't want to ignore the following even if they are dot-files
#
!.clang-format
!.cocciconfig
!.get_maintainer.ignore
!.gitattributes
!.gitignore
!.mailmap

#
# Generated include files
#
/include/config/
/include/generated/
/include/ksym/
/arch/*/include/generated/

# stgit generated dirs
patches-*

# quilt's files
patches
series

# cscope files
cscope.*
ncscope.*

# gnu global files
GPATH
GRTAGS
GSYMS
GTAGS

# id-utils files
ID

*.orig
*~
\#*#

#
# Leavings from module signing
#
extra_certificates
signing_key.pem
signing_key.priv
signing_key.x509
x509.genkey

# Kconfig presets
/all.config
/alldef.config
/allmod.config
/allno.config
/allrandom.config
/allyes.config

# Kconfig savedefconfig output
/defconfig

# Kdevelop4
*.kdev4

# Clang's compilation database file
/compile_commands.json

# Documentation toolchain
sphinx_*/
">import SimpleService # default module values (can be overridden per job in `config`) # update_every = 2 ORDER = ['cpufreq'] CHARTS = { 'cpufreq': { 'options': [None, 'CPU Clock', 'MHz', 'cpufreq', 'cpufreq', 'line'], 'lines': [ # lines are created dynamically in `check()` method ]} } class Service(SimpleService): def __init__(self, configuration=None, name=None): prefix = os.getenv('NETDATA_HOST_PREFIX', "") if prefix.endswith('/'): prefix = prefix[:-1] self.sys_dir = prefix + "/sys/devices" SimpleService.__init__(self, configuration=configuration, name=name) self.order = ORDER self.definitions = CHARTS self.fake_name = 'cpu' self.assignment = {} self.accurate_exists = True self.accurate_last = {} def _get_data(self): data = {} if self.accurate_exists: accurate_ok = True for name, paths in self.assignment.items(): last = self.accurate_last[name] current = {} deltas = {} ticks_since_last = 0 for line in open(paths['accurate'], 'r'): line = list(map(int, line.split())) current[line[0]] = line[1] ticks = line[1] - last.get(line[0], 0) ticks_since_last += ticks deltas[line[0]] = line[1] - last.get(line[0], 0) avg_freq = 0 if ticks_since_last != 0: for frequency, ticks in deltas.items(): avg_freq += frequency * ticks avg_freq /= ticks_since_last data[name] = avg_freq self.accurate_last[name] = current if avg_freq == 0 or ticks_since_last == 0: # Delta is either too large or nonexistent, fall back to # less accurate reading. This can happen if we switch # to/from the 'schedutil' governor, which doesn't report # stats. accurate_ok = False if accurate_ok: return data for name, paths in self.assignment.items(): data[name] = open(paths['inaccurate'], 'r').read() return data def check(self): try: self.sys_dir = str(self.configuration['sys_dir']) except (KeyError, TypeError): self.error("No path specified. Using: '" + self.sys_dir + "'") for path in glob.glob(self.sys_dir + '/system/cpu/cpu*/cpufreq/stats/time_in_state'): path_elem = path.split('/') cpu = path_elem[-4] if cpu not in self.assignment: self.assignment[cpu] = {} self.assignment[cpu]['accurate'] = path self.accurate_last[cpu] = {} if len(self.assignment) == 0: self.accurate_exists = False for path in glob.glob(self.sys_dir + '/system/cpu/cpu*/cpufreq/scaling_cur_freq'): path_elem = path.split('/') cpu = path_elem[-3] if cpu not in self.assignment: self.assignment[cpu] = {} self.assignment[cpu]['inaccurate'] = path if len(self.assignment) == 0: self.error("couldn't find a method to read cpufreq statistics") return False for name in sorted(self.assignment, key=lambda v: int(v[3:])): self.definitions[ORDER[0]]['lines'].append([name, name, 'absolute', 1, 1000]) return True