FreeBSD Bugzilla – Attachment 184542 Details for
Bug 219399
System panics after several hours of 14-threads-compilation orgies using poudriere on AMD Ryzen...
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
quick&dirty LUA script to read CPU temperatures; needs "superiotool"
nct6779d.lua (text/x-lua), 6.79 KB, created by
Nils Beyer
on 2017-07-20 11:31:36 UTC
(
hide
)
Description:
quick&dirty LUA script to read CPU temperatures; needs "superiotool"
Filename:
MIME Type:
Creator:
Nils Beyer
Created:
2017-07-20 11:31:36 UTC
Size:
6.79 KB
patch
obsolete
>#!/usr/bin/env lua52 > >------------------------------------------------------------------------------- >-- functions >------------------------------------------------------------------------------- >function _system(...) > local handle, retval > handle = io.popen(sprintf(...)) > retval = {} > for line in handle:lines() do > retval[#retval+1] = line > end > handle:close() > return ipairs(retval) >end > >function _fileContent(...) > return io.lines(sprintf(...)) >end > >function _stdout(...) > io.stdout:write(sprintf(...)) > io.stdout:flush() >end > >function _stderr(...) > io.stderr:write(sprintf(...)) > io.stderr:flush() >end > >function _info(...) > _stderr(sprintf("[INFO] %s\n", sprintf(...))) >end > >function _debug(...) > if DEBUG then > _stderr(sprintf("[DEBUG] %s\n", sprintf(...))) > end >end > >function _warning(...) > _stderr(sprintf("[WARNING] %s\n", sprintf(...))) >end > >function sprintf(...) > return string.format(...) >end > >function printf(...) > _stdout(sprintf(...)) >end >------------------------------------------------------------------------------- > > >------------------------------------------------------------------------------- >-- MAIN >------------------------------------------------------------------------------- >local bank = nil >local VALS = {} >for _,line in _system("superiotool -de") do > tmp = line:match("^Bank (%w):$") > if tmp then > bank = tmp > end > > if bank then > row, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, va, vb, vc, vd, ve, vf = line:match("^0(%w): (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w) (%w%w)") > if row then > reg = sprintf("%s%s", bank, row) > VALS[reg.."0"] = tonumber(v0, 16) > VALS[reg.."1"] = tonumber(v1, 16) > VALS[reg.."2"] = tonumber(v2, 16) > VALS[reg.."3"] = tonumber(v3, 16) > VALS[reg.."4"] = tonumber(v4, 16) > VALS[reg.."5"] = tonumber(v5, 16) > VALS[reg.."6"] = tonumber(v6, 16) > VALS[reg.."7"] = tonumber(v7, 16) > VALS[reg.."8"] = tonumber(v8, 16) > VALS[reg.."9"] = tonumber(v9, 16) > VALS[reg.."a"] = tonumber(va, 16) > VALS[reg.."b"] = tonumber(vb, 16) > VALS[reg.."c"] = tonumber(vc, 16) > VALS[reg.."d"] = tonumber(vd, 16) > VALS[reg.."e"] = tonumber(ve, 16) > VALS[reg.."f"] = tonumber(vf, 16) > end > end >end > > >--[[ >------------------------------------------------------------------------------ >------------------------------------------------------------------------------ >/* NCT6779 specific data */ > >static const u16 NCT6779_REG_IN[] = { > 0x480, 0x481, 0x482, 0x483, 0x484, 0x485, 0x486, 0x487, > 0x488, 0x489, 0x48a, 0x48b, 0x48c, 0x48d, 0x48e }; > >static const u16 NCT6779_REG_ALARM[NUM_REG_ALARM] = { > 0x459, 0x45A, 0x45B, 0x568 }; > >static const s8 NCT6779_ALARM_BITS[] = { > 0, 1, 2, 3, 8, 21, 20, 16, /* in0.. in7 */ > 17, 24, 25, 26, 27, 28, 29, /* in8..in14 */ > -1, /* unused */ > 6, 7, 11, 10, 23, /* fan1..fan5 */ > -1, -1, -1, /* unused */ > 4, 5, 13, -1, -1, -1, /* temp1..temp6 */ > 12, 9 }; /* intrusion0, intrusion1 */ > >static const s8 NCT6779_BEEP_BITS[] = { > 0, 1, 2, 3, 4, 5, 6, 7, /* in0.. in7 */ > 8, 9, 10, 11, 12, 13, 14, /* in8..in14 */ > 24, /* global beep enable */ > 25, 26, 27, 28, 29, /* fan1..fan5 */ > -1, -1, -1, /* unused */ > 16, 17, -1, -1, -1, -1, /* temp1..temp6 */ > 30, 31 }; /* intrusion0, intrusion1 */ > >static const u16 NCT6779_REG_FAN[] = { > 0x4b0, 0x4b2, 0x4b4, 0x4b6, 0x4b8, 0x4ba }; >static const u16 NCT6779_REG_FAN_PULSES[] = { > 0x644, 0x645, 0x646, 0x647, 0x648, 0x649 }; > >static const u16 NCT6779_REG_CRITICAL_PWM_ENABLE[] = { > 0x136, 0x236, 0x336, 0x836, 0x936, 0xa36 }; >#define NCT6779_CRITICAL_PWM_ENABLE_MASK 0x01 >static const u16 NCT6779_REG_CRITICAL_PWM[] = { > 0x137, 0x237, 0x337, 0x837, 0x937, 0xa37 }; > >static const u16 NCT6779_REG_TEMP[] = { 0x27, 0x150 }; >static const u16 NCT6779_REG_TEMP_MON[] = { 0x73, 0x75, 0x77, 0x79, 0x7b }; >static const u16 NCT6779_REG_TEMP_CONFIG[ARRAY_SIZE(NCT6779_REG_TEMP)] = { > 0x18, 0x152 }; >static const u16 NCT6779_REG_TEMP_HYST[ARRAY_SIZE(NCT6779_REG_TEMP)] = { > 0x3a, 0x153 }; >static const u16 NCT6779_REG_TEMP_OVER[ARRAY_SIZE(NCT6779_REG_TEMP)] = { > 0x39, 0x155 }; > >static const u16 NCT6779_REG_TEMP_OFFSET[] = { > 0x454, 0x455, 0x456, 0x44a, 0x44b, 0x44c }; > >static const char *const nct6779_temp_label[] = { > "", > "SYSTIN", > "CPUTIN", > "AUXTIN0", > "AUXTIN1", > "AUXTIN2", > "AUXTIN3", > "", > "SMBUSMASTER 0", > "SMBUSMASTER 1", > "SMBUSMASTER 2", > "SMBUSMASTER 3", > "SMBUSMASTER 4", > "SMBUSMASTER 5", > "SMBUSMASTER 6", > "SMBUSMASTER 7", > "PECI Agent 0", > "PECI Agent 1", > "PCH_CHIP_CPU_MAX_TEMP", > "PCH_CHIP_TEMP", > "PCH_CPU_TEMP", > "PCH_MCH_TEMP", > "PCH_DIM0_TEMP", > "PCH_DIM1_TEMP", > "PCH_DIM2_TEMP", > "PCH_DIM3_TEMP", > "BYTE_TEMP", > "", > "", > "", > "", > "Virtual_TEMP" >}; > >#define NCT6779_TEMP_MASK 0x07ffff7e >#define NCT6791_TEMP_MASK 0x87ffff7e > >static const u16 NCT6779_REG_TEMP_ALTERNATE[32] > = { 0x490, 0x491, 0x492, 0x493, 0x494, 0x495, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0x400, 0x401, 0x402, 0x404, 0x405, 0x406, 0x407, > 0x408, 0 }; > >static const u16 NCT6779_REG_TEMP_CRIT[32] = { > [15] = 0x709, > [16] = 0x70a, >}; > >/* NCT6791 specific data */ > >#define NCT6791_REG_HM_IO_SPACE_LOCK_ENABLE 0x28 > >static const u16 NCT6791_REG_WEIGHT_TEMP_SEL[6] = { 0, 0x239 }; >static const u16 NCT6791_REG_WEIGHT_TEMP_STEP[6] = { 0, 0x23a }; >static const u16 NCT6791_REG_WEIGHT_TEMP_STEP_TOL[6] = { 0, 0x23b }; >static const u16 NCT6791_REG_WEIGHT_DUTY_STEP[6] = { 0, 0x23c }; >static const u16 NCT6791_REG_WEIGHT_TEMP_BASE[6] = { 0, 0x23d }; >static const u16 NCT6791_REG_WEIGHT_DUTY_BASE[6] = { 0, 0x23e }; > >static const u16 NCT6791_REG_ALARM[NUM_REG_ALARM] = { > 0x459, 0x45A, 0x45B, 0x568, 0x45D }; > >static const s8 NCT6791_ALARM_BITS[] = { > 0, 1, 2, 3, 8, 21, 20, 16, /* in0.. in7 */ > 17, 24, 25, 26, 27, 28, 29, /* in8..in14 */ > -1, /* unused */ > 6, 7, 11, 10, 23, 33, /* fan1..fan6 */ > -1, -1, /* unused */ > 4, 5, 13, -1, -1, -1, /* temp1..temp6 */ >12, 9 }; /* intrusion0, intrusion1 */ >------------------------------------------------------------------------------ >------------------------------------------------------------------------------ >]]-- > > >printf("MB temperature: %d (hyst=%d, crit=%d)\n", VALS["027"], VALS["03a"], VALS["153"]) >printf("CPU temperature: %d (hyst=%d, crit=%d)\n", VALS["150"], VALS["153"], VALS["155"]) >printf("FAN1: %d\n", VALS["4b0"]) >printf("FAN1 pulse: %d\n", VALS["644"]) >printf("FAN2: %d\n", VALS["4b2"]) >printf("FAN2 pulse: %d\n", VALS["645"]) >printf("FAN3: %d\n", VALS["4b4"]) >printf("FAN3 pulse: %d\n", VALS["646"]) >printf("FAN4: %d\n", VALS["4b6"]) >printf("FAN4 pulse: %d\n", VALS["647"]) >printf("FAN5: %d\n", VALS["4b8"]) >printf("FAN5 pulse: %d\n", VALS["648"]) >printf("FAN6: %d\n", VALS["4ba"]) >printf("FAN6 pulse: %d\n", VALS["649"])
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 219399
:
182736
|
183054
|
184037
|
184051
|
184539
| 184542 |
184641
|
184707
|
184714
|
185022
|
186143