Skip to content
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

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

Decodetalkers
Copy link
Contributor

Log: this add a fsnotify

return
}

defer watcher.Close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这一行要放到162行

Comment on lines 183 to 194
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)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可以封装成一个函数

@Decodetalkers Decodetalkers force-pushed the support_fsnotify branch 3 times, most recently from c17e45d to e71dd5c Compare September 13, 2023 08:36
dengbo11
dengbo11 previously approved these changes Sep 13, 2023
dengbo11
dengbo11 previously approved these changes Sep 13, 2023
Comment on lines 243 to 241
} else {
continue
}

if err != nil {
logger.Debug("Read file error: ", err)
continue
}
if modeAndgovData.mode != "" {
m.setPropMode(modeAndgovData.mode)
m.setPropCpuGovernor(modeAndgovData.governor)
}
Copy link
Contributor

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)
}

@Decodetalkers Decodetalkers force-pushed the support_fsnotify branch 2 times, most recently from 1eb9006 to e62deea Compare September 13, 2023 10:16
dengbo11
dengbo11 previously approved these changes Sep 13, 2023
@deepin-ci-robot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Decodetalkers Decodetalkers merged commit 7530d9e into linuxdeepin:master Sep 14, 2023
14 of 16 checks passed
@Decodetalkers
Copy link
Contributor Author

/integrate

@github-actions
Copy link

AutoIntegrationPr Bot
auto integrate with pr url: deepin-community/Repository-Integration#508
PrNumber: 508
PrBranch: auto-integration-6180366599

@Decodetalkers
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants