-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: when power governer changed, mode not changed #552
fix: when power governer changed, mode not changed #552
Conversation
5265a8d
to
5430261
Compare
system/power1/manager.go
Outdated
return | ||
} | ||
|
||
defer watcher.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一行要放到162行
5430261
to
50c69f9
Compare
system/power1/manager.go
Outdated
data, err := os.ReadFile(pstateConfPath) | ||
if err == nil { | ||
status := strings.TrimSpace(string(data)) | ||
if status == m.balanceScalingGovernor { | ||
m.emitPropChangedMode("balance") | ||
} else if status == "performance" { | ||
m.emitPropChangedMode("performance") | ||
} else if status == "power" { | ||
m.emitPropChangedMode("powersave") | ||
} else { | ||
logger.Debug("Unknown status:", status) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里可以封装成一个函数
c17e45d
to
e71dd5c
Compare
8a96ca6
to
57bf736
Compare
57bf736
to
4a785d2
Compare
system/power1/manager.go
Outdated
} else { | ||
continue | ||
} | ||
|
||
if err != nil { | ||
logger.Debug("Read file error: ", err) | ||
continue | ||
} | ||
if modeAndgovData.mode != "" { | ||
m.setPropMode(modeAndgovData.mode) | ||
m.setPropCpuGovernor(modeAndgovData.governor) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (err ==nil && modeAndgovData.mode != "") {
m.setPropMode(modeAndgovData.mode)
m.setPropCpuGovernor(modeAndgovData.governor)
}
1eb9006
to
e62deea
Compare
e62deea
to
035024c
Compare
Log: this add a fsnotify
035024c
to
aadfc53
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Decodetalkers, dengbo11 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/integrate |
AutoIntegrationPr Bot |
Log: this add a fsnotify