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 |
+++ syncthing/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 |
+++ syncthing/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/host/host_freebsd_arm64.go b/host/host_freebsd_arm64.go |
157 |
new file mode 100644 |
158 |
index 00000000..88dc11fc |
159 |
--- /dev/null |
160 |
+++ syncthing/vendor/github.com/shirou/gopsutil/host/host_freebsd_arm64.go |
161 |
@@ -0,0 +1,39 @@ |
162 |
+// +build freebsd |
163 |
+// +build arm64 |
164 |
+// Code generated by cmd/cgo -godefs; DO NOT EDIT. |
165 |
+// cgo -godefs host/types_freebsd.go |
166 |
+ |
167 |
+package host |
168 |
+ |
169 |
+const ( |
170 |
+ sizeofPtr = 0x8 |
171 |
+ sizeofShort = 0x2 |
172 |
+ sizeofInt = 0x4 |
173 |
+ sizeofLong = 0x8 |
174 |
+ sizeofLongLong = 0x8 |
175 |
+ sizeOfUtmpx = 0xc5 |
176 |
+) |
177 |
+ |
178 |
+type ( |
179 |
+ _C_short int16 |
180 |
+ _C_int int32 |
181 |
+ _C_long int64 |
182 |
+ _C_long_long int64 |
183 |
+) |
184 |
+ |
185 |
+type Utmp struct { |
186 |
+ Line [8]int8 |
187 |
+ Name [16]int8 |
188 |
+ Host [16]int8 |
189 |
+ Time int32 |
190 |
+} |
191 |
+ |
192 |
+type Utmpx struct { |
193 |
+ Type uint8 |
194 |
+ Tv uint64 |
195 |
+ Id [8]int8 |
196 |
+ Pid uint32 |
197 |
+ User [32]int8 |
198 |
+ Line [16]int8 |
199 |
+ Host [128]int8 |
200 |
+} |
201 |
diff --git a/process/process_freebsd_arm64.go b/process/process_freebsd_arm64.go |
202 |
new file mode 100644 |
203 |
index 00000000..99781d1a |
204 |
--- /dev/null |
205 |
+++ syncthing/vendor/github.com/shirou/gopsutil/process/process_freebsd_arm64.go |
206 |
@@ -0,0 +1,201 @@ |
207 |
+// +build freebsd |
208 |
+// +build arm64 |
209 |
+// Code generated by cmd/cgo -godefs; DO NOT EDIT. |
210 |
+// cgo -godefs process/types_freebsd.go |
211 |
+ |
212 |
+package process |
213 |
+ |
214 |
+const ( |
215 |
+ CTLKern = 1 |
216 |
+ KernProc = 14 |
217 |
+ KernProcPID = 1 |
218 |
+ KernProcProc = 8 |
219 |
+ KernProcPathname = 12 |
220 |
+ KernProcArgs = 7 |
221 |
+) |
222 |
+ |
223 |
+const ( |
224 |
+ sizeofPtr = 0x8 |
225 |
+ sizeofShort = 0x2 |
226 |
+ sizeofInt = 0x4 |
227 |
+ sizeofLong = 0x8 |
228 |
+ sizeofLongLong = 0x8 |
229 |
+) |
230 |
+ |
231 |
+const ( |
232 |
+ sizeOfKinfoVmentry = 0x488 |
233 |
+ sizeOfKinfoProc = 0x440 |
234 |
+) |
235 |
+ |
236 |
+const ( |
237 |
+ SIDL = 1 |
238 |
+ SRUN = 2 |
239 |
+ SSLEEP = 3 |
240 |
+ SSTOP = 4 |
241 |
+ SZOMB = 5 |
242 |
+ SWAIT = 6 |
243 |
+ SLOCK = 7 |
244 |
+) |
245 |
+ |
246 |
+type ( |
247 |
+ _C_short int16 |
248 |
+ _C_int int32 |
249 |
+ _C_long int64 |
250 |
+ _C_long_long int64 |
251 |
+) |
252 |
+ |
253 |
+type Timespec struct { |
254 |
+ Sec int64 |
255 |
+ Nsec int64 |
256 |
+} |
257 |
+ |
258 |
+type Timeval struct { |
259 |
+ Sec int64 |
260 |
+ Usec int64 |
261 |
+} |
262 |
+ |
263 |
+type Rusage struct { |
264 |
+ Utime Timeval |
265 |
+ Stime Timeval |
266 |
+ Maxrss int64 |
267 |
+ Ixrss int64 |
268 |
+ Idrss int64 |
269 |
+ Isrss int64 |
270 |
+ Minflt int64 |
271 |
+ Majflt int64 |
272 |
+ Nswap int64 |
273 |
+ Inblock int64 |
274 |
+ Oublock int64 |
275 |
+ Msgsnd int64 |
276 |
+ Msgrcv int64 |
277 |
+ Nsignals int64 |
278 |
+ Nvcsw int64 |
279 |
+ Nivcsw int64 |
280 |
+} |
281 |
+ |
282 |
+type Rlimit struct { |
283 |
+ Cur int64 |
284 |
+ Max int64 |
285 |
+} |
286 |
+ |
287 |
+type KinfoProc struct { |
288 |
+ Structsize int32 |
289 |
+ Layout int32 |
290 |
+ Args *int64 /* pargs */ |
291 |
+ Paddr *int64 /* proc */ |
292 |
+ Addr *int64 /* user */ |
293 |
+ Tracep *int64 /* vnode */ |
294 |
+ Textvp *int64 /* vnode */ |
295 |
+ Fd *int64 /* filedesc */ |
296 |
+ Vmspace *int64 /* vmspace */ |
297 |
+ Wchan *byte |
298 |
+ Pid int32 |
299 |
+ Ppid int32 |
300 |
+ Pgid int32 |
301 |
+ Tpgid int32 |
302 |
+ Sid int32 |
303 |
+ Tsid int32 |
304 |
+ Jobc int16 |
305 |
+ Spare_short1 int16 |
306 |
+ Tdev_freebsd11 uint32 |
307 |
+ Siglist [16]byte /* sigset */ |
308 |
+ Sigmask [16]byte /* sigset */ |
309 |
+ Sigignore [16]byte /* sigset */ |
310 |
+ Sigcatch [16]byte /* sigset */ |
311 |
+ Uid uint32 |
312 |
+ Ruid uint32 |
313 |
+ Svuid uint32 |
314 |
+ Rgid uint32 |
315 |
+ Svgid uint32 |
316 |
+ Ngroups int16 |
317 |
+ Spare_short2 int16 |
318 |
+ Groups [16]uint32 |
319 |
+ Size uint64 |
320 |
+ Rssize int64 |
321 |
+ Swrss int64 |
322 |
+ Tsize int64 |
323 |
+ Dsize int64 |
324 |
+ Ssize int64 |
325 |
+ Xstat uint16 |
326 |
+ Acflag uint16 |
327 |
+ Pctcpu uint32 |
328 |
+ Estcpu uint32 |
329 |
+ Slptime uint32 |
330 |
+ Swtime uint32 |
331 |
+ Cow uint32 |
332 |
+ Runtime uint64 |
333 |
+ Start Timeval |
334 |
+ Childtime Timeval |
335 |
+ Flag int64 |
336 |
+ Kiflag int64 |
337 |
+ Traceflag int32 |
338 |
+ Stat uint8 |
339 |
+ Nice int8 |
340 |
+ Lock uint8 |
341 |
+ Rqindex uint8 |
342 |
+ Oncpu_old uint8 |
343 |
+ Lastcpu_old uint8 |
344 |
+ Tdname [17]uint8 |
345 |
+ Wmesg [9]uint8 |
346 |
+ Login [18]uint8 |
347 |
+ Lockname [9]uint8 |
348 |
+ Comm [20]int8 |
349 |
+ Emul [17]uint8 |
350 |
+ Loginclass [18]uint8 |
351 |
+ Moretdname [4]uint8 |
352 |
+ Sparestrings [46]uint8 |
353 |
+ Spareints [2]int32 |
354 |
+ Tdev uint64 |
355 |
+ Oncpu int32 |
356 |
+ Lastcpu int32 |
357 |
+ Tracer int32 |
358 |
+ Flag2 int32 |
359 |
+ Fibnum int32 |
360 |
+ Cr_flags uint32 |
361 |
+ Jid int32 |
362 |
+ Numthreads int32 |
363 |
+ Tid int32 |
364 |
+ Pri Priority |
365 |
+ Rusage Rusage |
366 |
+ Rusage_ch Rusage |
367 |
+ Pcb *int64 /* pcb */ |
368 |
+ Kstack *byte |
369 |
+ Udata *byte |
370 |
+ Tdaddr *int64 /* thread */ |
371 |
+ Spareptrs [6]*byte |
372 |
+ Sparelongs [12]int64 |
373 |
+ Sflag int64 |
374 |
+ Tdflags int64 |
375 |
+} |
376 |
+ |
377 |
+type Priority struct { |
378 |
+ Class uint8 |
379 |
+ Level uint8 |
380 |
+ Native uint8 |
381 |
+ User uint8 |
382 |
+} |
383 |
+ |
384 |
+type KinfoVmentry struct { |
385 |
+ Structsize int32 |
386 |
+ Type int32 |
387 |
+ Start uint64 |
388 |
+ End uint64 |
389 |
+ Offset uint64 |
390 |
+ Vn_fileid uint64 |
391 |
+ Vn_fsid_freebsd11 uint32 |
392 |
+ Flags int32 |
393 |
+ Resident int32 |
394 |
+ Private_resident int32 |
395 |
+ Protection int32 |
396 |
+ Ref_count int32 |
397 |
+ Shadow_count int32 |
398 |
+ Vn_type int32 |
399 |
+ Vn_size uint64 |
400 |
+ Vn_rdev_freebsd11 uint32 |
401 |
+ Vn_mode uint16 |
402 |
+ Status uint16 |
403 |
+ Vn_fsid uint64 |
404 |
+ Vn_rdev uint64 |
405 |
+ X_kve_ispare [8]int32 |
406 |
+ Path [1024]uint8 |
407 |
+} |