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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
|
https://github.com/shirou/gopsutil/commit/270f6afc220d6dcbc9e1d14e0f6f65fb4d29dfaf
From 270f6afc220d6dcbc9e1d14e0f6f65fb4d29dfaf Mon Sep 17 00:00:00 2001
From: Dmitri Goutnik <dg@syrec.org>
Date: Tue, 17 Dec 2019 02:51:35 -0500
Subject: [PATCH] Add support for freebsd/arm64
---
Gopkg.lock | 4 +-
cpu/cpu_freebsd_arm64.go | 9 ++
disk/disk_freebsd_arm64.go | 115 ++++++++++++++++++
host/host_freebsd_arm64.go | 39 ++++++
process/process_freebsd_arm64.go | 201 +++++++++++++++++++++++++++++++
6 files changed, 369 insertions(+), 2 deletions(-)
create mode 100644 cpu/cpu_freebsd_arm64.go
create mode 100644 disk/disk_freebsd_arm64.go
create mode 100644 host/host_freebsd_arm64.go
create mode 100644 process/process_freebsd_arm64.go
diff --git a/cpu/cpu_freebsd_arm64.go b/cpu/cpu_freebsd_arm64.go
new file mode 100644
index 00000000..57e14528
--- /dev/null
+++ vendor/github.com/DataDog/gopsutil/cpu/cpu_freebsd_arm64.go
@@ -0,0 +1,9 @@
+package cpu
+
+type cpuTimes struct {
+ User uint64
+ Nice uint64
+ Sys uint64
+ Intr uint64
+ Idle uint64
+}
diff --git a/disk/disk_freebsd_arm64.go b/disk/disk_freebsd_arm64.go
new file mode 100644
index 00000000..aff604c0
--- /dev/null
+++ vendor/github.com/DataDog/gopsutil/disk/disk_freebsd_arm64.go
@@ -0,0 +1,115 @@
+// +build freebsd
+// +build arm64
+// Code generated by cmd/cgo -godefs; DO NOT EDIT.
+// cgo -godefs disk/types_freebsd.go
+
+package disk
+
+const (
+ sizeofPtr = 0x8
+ sizeofShort = 0x2
+ sizeofInt = 0x4
+ sizeofLong = 0x8
+ sizeofLongLong = 0x8
+ sizeofLongDouble = 0x8
+
+ DEVSTAT_NO_DATA = 0x00
+ DEVSTAT_READ = 0x01
+ DEVSTAT_WRITE = 0x02
+ DEVSTAT_FREE = 0x03
+
+ MNT_RDONLY = 0x00000001
+ MNT_SYNCHRONOUS = 0x00000002
+ MNT_NOEXEC = 0x00000004
+ MNT_NOSUID = 0x00000008
+ MNT_UNION = 0x00000020
+ MNT_ASYNC = 0x00000040
+ MNT_SUIDDIR = 0x00100000
+ MNT_SOFTDEP = 0x00200000
+ MNT_NOSYMFOLLOW = 0x00400000
+ MNT_GJOURNAL = 0x02000000
+ MNT_MULTILABEL = 0x04000000
+ MNT_ACLS = 0x08000000
+ MNT_NOATIME = 0x10000000
+ MNT_NOCLUSTERR = 0x40000000
+ MNT_NOCLUSTERW = 0x80000000
+ MNT_NFS4ACLS = 0x00000010
+
+ MNT_WAIT = 1
+ MNT_NOWAIT = 2
+ MNT_LAZY = 3
+ MNT_SUSPEND = 4
+)
+
+const (
+ sizeOfDevstat = 0x120
+)
+
+type (
+ _C_short int16
+ _C_int int32
+ _C_long int64
+ _C_long_long int64
+ _C_long_double int64
+)
+
+type Statfs struct {
+ Version uint32
+ Type uint32
+ Flags uint64
+ Bsize uint64
+ Iosize uint64
+ Blocks uint64
+ Bfree uint64
+ Bavail int64
+ Files uint64
+ Ffree int64
+ Syncwrites uint64
+ Asyncwrites uint64
+ Syncreads uint64
+ Asyncreads uint64
+ Spare [10]uint64
+ Namemax uint32
+ Owner uint32
+ Fsid Fsid
+ Charspare [80]uint8
+ Fstypename [16]int8
+ Mntfromname [1024]int8
+ Mntonname [1024]int8
+}
+type Fsid struct {
+ Val [2]int32
+}
+
+type Devstat struct {
+ Sequence0 uint32
+ Allocated int32
+ Start_count uint32
+ End_count uint32
+ Busy_from Bintime
+ Dev_links _Ctype_struct___0
+ Device_number uint32
+ Device_name [16]int8
+ Unit_number int32
+ Bytes [4]uint64
+ Operations [4]uint64
+ Duration [4]Bintime
+ Busy_time Bintime
+ Creation_time Bintime
+ Block_size uint32
+ Tag_types [3]uint64
+ Flags uint32
+ Device_type uint32
+ Priority uint32
+ Id *byte
+ Sequence1 uint32
+ Pad_cgo_0 [4]byte
+}
+type Bintime struct {
+ Sec int64
+ Frac uint64
+}
+
+type _Ctype_struct___0 struct {
+ Empty uint64
+}
diff --git a/host/host_freebsd_arm64.go b/host/host_freebsd_arm64.go
diff --git a/process/process_freebsd_arm64.go b/process/process_freebsd_arm64.go
new file mode 100644
index 00000000..99781d1a
--- /dev/null
+++ vendor/github.com/DataDog/gopsutil/process/process_freebsd_arm64.go
@@ -0,0 +1,201 @@
+// +build freebsd
+// +build arm64
+// Code generated by cmd/cgo -godefs; DO NOT EDIT.
+// cgo -godefs process/types_freebsd.go
+
+package process
+
+const (
+ CTLKern = 1
+ KernProc = 14
+ KernProcPID = 1
+ KernProcProc = 8
+ KernProcPathname = 12
+ KernProcArgs = 7
+)
+
+const (
+ sizeofPtr = 0x8
+ sizeofShort = 0x2
+ sizeofInt = 0x4
+ sizeofLong = 0x8
+ sizeofLongLong = 0x8
+)
+
+const (
+ sizeOfKinfoVmentry = 0x488
+ sizeOfKinfoProc = 0x440
+)
+
+const (
+ SIDL = 1
+ SRUN = 2
+ SSLEEP = 3
+ SSTOP = 4
+ SZOMB = 5
+ SWAIT = 6
+ SLOCK = 7
+)
+
+type (
+ _C_short int16
+ _C_int int32
+ _C_long int64
+ _C_long_long int64
+)
+
+type Timespec struct {
+ Sec int64
+ Nsec int64
+}
+
+type Timeval struct {
+ Sec int64
+ Usec int64
+}
+
+type Rusage struct {
+ Utime Timeval
+ Stime Timeval
+ Maxrss int64
+ Ixrss int64
+ Idrss int64
+ Isrss int64
+ Minflt int64
+ Majflt int64
+ Nswap int64
+ Inblock int64
+ Oublock int64
+ Msgsnd int64
+ Msgrcv int64
+ Nsignals int64
+ Nvcsw int64
+ Nivcsw int64
+}
+
+type Rlimit struct {
+ Cur int64
+ Max int64
+}
+
+type KinfoProc struct {
+ Structsize int32
+ Layout int32
+ Args *int64 /* pargs */
+ Paddr *int64 /* proc */
+ Addr *int64 /* user */
+ Tracep *int64 /* vnode */
+ Textvp *int64 /* vnode */
+ Fd *int64 /* filedesc */
+ Vmspace *int64 /* vmspace */
+ Wchan *byte
+ Pid int32
+ Ppid int32
+ Pgid int32
+ Tpgid int32
+ Sid int32
+ Tsid int32
+ Jobc int16
+ Spare_short1 int16
+ Tdev_freebsd11 uint32
+ Siglist [16]byte /* sigset */
+ Sigmask [16]byte /* sigset */
+ Sigignore [16]byte /* sigset */
+ Sigcatch [16]byte /* sigset */
+ Uid uint32
+ Ruid uint32
+ Svuid uint32
+ Rgid uint32
+ Svgid uint32
+ Ngroups int16
+ Spare_short2 int16
+ Groups [16]uint32
+ Size uint64
+ Rssize int64
+ Swrss int64
+ Tsize int64
+ Dsize int64
+ Ssize int64
+ Xstat uint16
+ Acflag uint16
+ Pctcpu uint32
+ Estcpu uint32
+ Slptime uint32
+ Swtime uint32
+ Cow uint32
+ Runtime uint64
+ Start Timeval
+ Childtime Timeval
+ Flag int64
+ Kiflag int64
+ Traceflag int32
+ Stat int8
+ Nice int8
+ Lock uint8
+ Rqindex uint8
+ Oncpu_old uint8
+ Lastcpu_old uint8
+ Tdname [17]uint8
+ Wmesg [9]uint8
+ Login [18]uint8
+ Lockname [9]uint8
+ Comm [20]int8
+ Emul [17]uint8
+ Loginclass [18]uint8
+ Moretdname [4]uint8
+ Sparestrings [46]uint8
+ Spareints [2]int32
+ Tdev uint64
+ Oncpu int32
+ Lastcpu int32
+ Tracer int32
+ Flag2 int32
+ Fibnum int32
+ Cr_flags uint32
+ Jid int32
+ Numthreads int32
+ Tid int32
+ Pri Priority
+ Rusage Rusage
+ Rusage_ch Rusage
+ Pcb *int64 /* pcb */
+ Kstack *byte
+ Udata *byte
+ Tdaddr *int64 /* thread */
+ Spareptrs [6]*byte
+ Sparelongs [12]int64
+ Sflag int64
+ Tdflags int64
+}
+
+type Priority struct {
+ Class uint8
+ Level uint8
+ Native uint8
+ User uint8
+}
+
+type KinfoVmentry struct {
+ Structsize int32
+ Type int32
+ Start uint64
+ End uint64
+ Offset uint64
+ Vn_fileid uint64
+ Vn_fsid_freebsd11 uint32
+ Flags int32
+ Resident int32
+ Private_resident int32
+ Protection int32
+ Ref_count int32
+ Shadow_count int32
+ Vn_type int32
+ Vn_size uint64
+ Vn_rdev_freebsd11 uint32
+ Vn_mode uint16
+ Status uint16
+ Vn_fsid uint64
+ Vn_rdev uint64
+ X_kve_ispare [8]int32
+ Path [1024]uint8
+}
--- /dev/null
+++ vendor/github.com/DataDog/gopsutil/host/host_freebsd_arm64.go
@@ -0,0 +1,44 @@
+// Created by cgo -godefs - DO NOT EDIT
+// cgo -godefs types_freebsd.go
+
+package host
+
+const (
+ sizeofPtr = 0x8
+ sizeofShort = 0x2
+ sizeofInt = 0x4
+ sizeofLong = 0x8
+ sizeofLongLong = 0x8
+ sizeOfUtmpx = 197 // TODO: why should 197, not 0x118
+)
+
+type (
+ _C_short int16
+ _C_int int32
+ _C_long int64
+ _C_long_long int64
+)
+
+type Utmp struct {
+ Line [8]int8
+ Name [16]int8
+ Host [16]int8
+ Time int32
+}
+
+type Utmpx struct {
+ Type int16
+ Tv Timeval
+ Id [8]int8
+ Pid int32
+ User [32]int8
+ Line [16]int8
+ Host [125]int8
+ // Host [128]int8
+ // X__ut_spare [64]int8
+}
+
+type Timeval struct {
+ Sec [4]byte
+ Usec [3]byte
+}
|