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