diff --git a/socpowerbuddy_swift.xcodeproj/xcuserdata/eomsehwan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/socpowerbuddy_swift.xcodeproj/xcuserdata/eomsehwan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
index 8c31a10..4263381 100644
--- a/socpowerbuddy_swift.xcodeproj/xcuserdata/eomsehwan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
+++ b/socpowerbuddy_swift.xcodeproj/xcuserdata/eomsehwan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -2363,5 +2363,37 @@
landmarkType = "9">
+
+
+
+
+
+
+
+
diff --git a/socpowerbuddy_swift/head.swift b/socpowerbuddy_swift/head.swift
index 39ac054..f6bdb17 100644
--- a/socpowerbuddy_swift/head.swift
+++ b/socpowerbuddy_swift/head.swift
@@ -102,3 +102,17 @@ struct mem_info {
var used: [Double] = [0, 0]
var free: [Double] = [0, 0]
}
+
+struct avg_pwr {
+ var sys: [Double] = []
+ var cpu: [Float] = []
+ var gpu: [Float] = []
+ var ram: [Float] = []
+}
+
+struct peak_pwr {
+ var sys: Double = 0
+ var cpu: Float = 0
+ var gpu: Float = 0
+ var ram: Float = 0
+}
diff --git a/socpowerbuddy_swift/neoasitop.swift b/socpowerbuddy_swift/neoasitop.swift
index a8294ae..bdb6098 100644
--- a/socpowerbuddy_swift/neoasitop.swift
+++ b/socpowerbuddy_swift/neoasitop.swift
@@ -15,7 +15,7 @@ var sd = static_data()
var cmd = cmd_data()
let sens = SensorsReader()
-let cur_ver = "v2.8"
+let cur_ver = "v2.9"
var newVersion = false
struct Neoasitop: ParsableCommand {
@@ -183,6 +183,9 @@ struct Neoasitop: ParsableCommand {
var scr = scrin!.tbx
var bottomPnt: OpaquePointer? = nil
xy = scrin!.xy
+
+ var pwr_max: peak_pwr = peak_pwr()
+ var pwr_avg: avg_pwr = avg_pwr()
while true {
autoreleasepool {
@@ -201,11 +204,32 @@ struct Neoasitop: ParsableCommand {
monInfo.cpu_pwr.val = cpu_pwr
monInfo.gpu_pwr.val = gpu_pwr
+ monInfo.sys_pwr_max = pwr_max.sys
+ monInfo.cpu_pwr_max = pwr_max.cpu
+ monInfo.gpu_pwr_max = pwr_max.gpu
+ monInfo.ram_pwr_max = pwr_max.ram
+
+ monInfo.sys_pwr_avg = pwr_avg.sys
+ monInfo.cpu_pwr_avg = pwr_avg.cpu
+ monInfo.gpu_pwr_avg = pwr_avg.gpu
+ monInfo.ram_pwr_avg = pwr_avg.ram
+
sample(iorep: iorep, sd: sd, vd: &vd!, cmd: cmd) // 데이터 샘플링 (애플 비공개 함수 이용)
//print("sampling finish")
format(sd: &sd, vd: &vd!) // 포매팅
//print("formatting finish")
summary(sd: sd, vd: vd!, rd: &rd!, rvd: &monInfo, opt: avg)
+
+ pwr_max.sys = monInfo.sys_pwr_max
+ pwr_max.cpu = monInfo.cpu_pwr_max
+ pwr_max.gpu = monInfo.gpu_pwr_max
+ pwr_max.ram = monInfo.ram_pwr_max
+
+ pwr_avg.sys = monInfo.sys_pwr_avg
+ pwr_avg.cpu = monInfo.cpu_pwr_avg
+ pwr_avg.gpu = monInfo.gpu_pwr_avg
+ pwr_avg.ram = monInfo.ram_pwr_avg
+
rd = nil
vd = nil
}
diff --git a/socpowerbuddy_swift/sampler.swift b/socpowerbuddy_swift/sampler.swift
index 39f536e..59e0f09 100644
--- a/socpowerbuddy_swift/sampler.swift
+++ b/socpowerbuddy_swift/sampler.swift
@@ -836,7 +836,7 @@ func summary(sd: static_data, vd: variating_data, rd: inout render_data, rvd: in
}
form = "CPU: %.2fW"
if stat_disp {
- form += " (avd: %.\(pwr_unit)fW peak: %.\(pwr_unit)fW)"
+ form += " (avg: %.\(pwr_unit)fW peak: %.\(pwr_unit)fW)"
}
rvd.cpu_pwr.title = String(
format: form,
@@ -868,7 +868,7 @@ func summary(sd: static_data, vd: variating_data, rd: inout render_data, rvd: in
}
form = "GPU: %.2fW"
if stat_disp {
- form += " (avd: %.\(pwr_unit)fW peak: %.\(pwr_unit)fW)"
+ form += " (avg: %.\(pwr_unit)fW peak: %.\(pwr_unit)fW)"
}
rvd.gpu_pwr.title = String(
format: form,