Skip to content

Commit 9381dd8

Browse files
authored
Merge pull request #179 from angelabriel/master
Changes as result of the tests in the last week
2 parents 491617f + 3faaeb9 commit 9381dd8

File tree

18 files changed

+127
-80
lines changed

18 files changed

+127
-80
lines changed

actions/actions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func SelectAction(writer io.Writer, stApp *app.App, saptuneVers string) {
103103
case "configure":
104104
ConfigureAction(writer, system.CliArg(2), system.CliArgs(3), stApp)
105105
case "refresh":
106-
RefreshAction(writer, system.CliArg(2), stApp)
106+
RefreshAction(os.Stdin, writer, system.CliArg(2), stApp)
107107
case "revert":
108108
RevertAction(writer, system.CliArg(2), stApp)
109109
case "staging":
@@ -121,11 +121,11 @@ func SelectAction(writer io.Writer, stApp *app.App, saptuneVers string) {
121121
}
122122

123123
// RefreshAction refreshes all applied Notes
124-
func RefreshAction(writer io.Writer, actionName string, tuneApp *app.App) {
124+
func RefreshAction(reader io.Reader, writer io.Writer, actionName string, tuneApp *app.App) {
125125
if actionName != "applied" {
126126
PrintHelpAndExit(writer, 1)
127127
}
128-
NoteActionRefresh(writer, "", tuneApp)
128+
NoteActionRefresh(reader, writer, "", tuneApp)
129129
}
130130

131131
// VerifyAction verifies all applied Notes

actions/cmdsyntax.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Daemon control:
66
saptune [--format FORMAT] [--force-color] [--fun] daemon ( start | stop | status [--non-compliance-check] ) ATTENTION: deprecated
77
saptune [--format FORMAT] [--force-color] [--fun] service ( start | stop | restart | takeover | enable | disable | enablestart | disablestop | status [--non-compliance-check] )
88
Tune system according to SAP and SUSE notes:
9-
saptune [--format FORMAT] [--force-color] [--fun] note ( list | verify | refresh | revertall | enabled | applied )
9+
saptune [--format FORMAT] [--force-color] [--fun] note ( list | verify | revertall | enabled | applied )
1010
saptune [--format FORMAT] [--force-color] [--fun] note ( apply | simulate | customise | create | edit | revert | show | delete ) NOTEID
11-
saptune [--format FORMAT] [--force-color] [--fun] note refresh [NOTEID|applied]
11+
saptune [--format FORMAT] [--force-color] [--fun] note refresh [NOTEID|applied] ATTENTION: experimental
1212
saptune [--format FORMAT] [--force-color] [--fun] note verify [--colorscheme SCHEME] [--show-non-compliant] [NOTEID|applied]
1313
saptune [--format FORMAT] [--force-color] [--fun] note rename NOTEID NEWNOTEID
1414
Tune system for all notes applicable to your SAP solution:
@@ -27,7 +27,7 @@ Config (re-)settings:
2727
Verify all applied Notes:
2828
saptune [--format FORMAT] [--force-color] [--fun] verify applied
2929
Refresh all applied Notes:
30-
saptune [--format FORMAT] [--force-color] [--fun] refresh applied
30+
saptune [--format FORMAT] [--force-color] [--fun] refresh applied ATTENTION: experimental
3131
Revert all parameters tuned by the SAP notes or solutions:
3232
saptune [--format FORMAT] [--force-color] [--fun] revert all
3333
Remove the pending lock file from a former saptune call
@@ -55,9 +55,9 @@ func cmdLineSyntax16() string {
5555
Daemon control:
5656
saptune [--format FORMAT] [--force-color] [--fun] service ( start | stop | restart | takeover | enable | disable | enablestart | disablestop | status [--non-compliance-check] )
5757
Tune system according to SAP and SUSE notes:
58-
saptune [--format FORMAT] [--force-color] [--fun] note ( list | verify | refresh | revertall | enabled | applied )
58+
saptune [--format FORMAT] [--force-color] [--fun] note ( list | verify | revertall | enabled | applied )
5959
saptune [--format FORMAT] [--force-color] [--fun] note ( apply | customise | create | edit | revert | show | delete ) NOTEID
60-
saptune [--format FORMAT] [--force-color] [--fun] note refresh [NOTEID|applied]
60+
saptune [--format FORMAT] [--force-color] [--fun] note refresh [NOTEID|applied] ATTENTION: experimental
6161
saptune [--format FORMAT] [--force-color] [--fun] note verify [--colorscheme SCHEME] [--show-non-compliant] [NOTEID|applied]
6262
saptune [--format FORMAT] [--force-color] [--fun] note rename NOTEID NEWNOTEID
6363
Tune system for all notes applicable to your SAP solution:
@@ -76,7 +76,7 @@ Config (re-)settings:
7676
Verify all applied Notes:
7777
saptune [--format FORMAT] [--force-color] [--fun] verify applied
7878
Refresh all applied Notes:
79-
saptune [--format FORMAT] [--force-color] [--fun] refresh applied
79+
saptune [--format FORMAT] [--force-color] [--fun] refresh applied ATTENTION: experimental
8080
Revert all parameters tuned by the SAP notes or solutions:
8181
saptune [--format FORMAT] [--force-color] [--fun] revert all
8282
Remove the pending lock file from a former saptune call

actions/noteacts.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func NoteAction(writer io.Writer, actionName, noteID, newNoteID string, tuneApp
4040
case "delete":
4141
NoteActionDelete(os.Stdin, writer, noteID, tuneApp)
4242
case "refresh":
43-
NoteActionRefresh(writer, noteID, tuneApp)
43+
NoteActionRefresh(os.Stdin, writer, noteID, tuneApp)
4444
case "rename":
4545
NoteActionRename(os.Stdin, writer, noteID, newNoteID, tuneApp)
4646
case "revert":
@@ -491,7 +491,14 @@ func NoteActionApplied(writer io.Writer, tuneApp *app.App) {
491491

492492
// NoteActionRefresh re-applies Note parameter settings to the system
493493
// if an already applied Note got changed.
494-
func NoteActionRefresh(writer io.Writer, noteID string, tuneApp *app.App) {
494+
func NoteActionRefresh(reader io.Reader, writer io.Writer, noteID string, tuneApp *app.App) {
495+
system.NoticeLog("ATTENTION: the action 'note refresh' is experimental!")
496+
txtConfirm := fmt.Sprintf("Do you really want to continue to test this experimental action?")
497+
if !readYesNo(txtConfirm, reader, writer) {
498+
system.NoticeLog("Note action 'refresh' aborted by user interaction")
499+
system.ErrorExit("", 0)
500+
}
501+
495502
errCount := 0
496503
noteList := make([]string, 0)
497504
if noteID == "" || noteID == "applied" {

actions/stagingacts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ func handleAppliedSolution(stageName string, tApp *app.App) {
523523
for _, note := range sol {
524524
// check, if in NoteApplyOrder
525525
pos := tApp.PositionInNoteApplyOrder(note)
526-
if pos < 0 {
526+
if pos < 0 {
527527
// note not available, skip
528528
continue
529529
}

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ func checkSaptuneConfigFile(saptuneConf string) string {
288288
if len(missingKey) != 0 {
289289
system.ErrorExit("File '%s' is broken. Missing variables '%s'", saptuneConf, strings.Join(missingKey, ", "), 128)
290290
}
291+
// set internal 'excludeDirs' for later use during parsing Notes
291292
txtparser.GetSysctlExcludes(sconf.GetString("SKIP_SYSCTL_FILES", ""))
292293
stageVal := sconf.GetString("STAGING", "")
293294
if stageVal != "true" && stageVal != "false" {

main_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ func TestCheckSaptuneConfigFile(t *testing.T) {
137137
logSwitch := map[string]string{"verbose": "", "debug": ""}
138138
// check saptune version and debug
139139
saptuneConf := fmt.Sprintf("%s/saptune_VersAndDebug", TstFilesInGOPATH)
140-
//buffer := bytes.Buffer{}
141140

142141
lSwitch := logSwitch
143142
saptuneVers := checkSaptuneConfigFile(saptuneConf)
@@ -152,19 +151,14 @@ func TestCheckSaptuneConfigFile(t *testing.T) {
152151
t.Errorf("wrong value for 'VERBOSE' - '%+v' instead of 'on'\n", lSwitch["debug"])
153152
}
154153

155-
//buffer.Reset()
156-
157154
errExitbuffer := bytes.Buffer{}
158155
tstwriter = &errExitbuffer
159156

160157
// check missing variable
161158
saptuneConf = fmt.Sprintf("%s/saptune_MissingVar", TstFilesInGOPATH)
162159
matchTxt := fmt.Sprintf("ERROR: File '%s' is broken. Missing variables 'COLOR_SCHEME'\n", saptuneConf)
163-
//lSwitch = logSwitch
164160
_ = checkSaptuneConfigFile(saptuneConf)
165161

166-
//txt := buffer.String()
167-
//checkOut(t, txt, matchTxt)
168162
if tstRetErrorExit != 128 {
169163
t.Errorf("error exit should be '128' and NOT '%v'\n", tstRetErrorExit)
170164
}
@@ -174,18 +168,14 @@ func TestCheckSaptuneConfigFile(t *testing.T) {
174168
}
175169

176170
// initialise next test
177-
//buffer.Reset()
178171
errExitbuffer.Reset()
179172

180173
// check wrong STAGING value
181174
saptuneConf = fmt.Sprintf("%s/saptune_WrongStaging", TstFilesInGOPATH)
182175
saptuneVers = ""
183176
matchTxt = fmt.Sprintf("ERROR: Variable 'STAGING' from file '%s' contains a wrong value 'hugo'. Needs to be 'true' or 'false'\n", saptuneConf)
184-
//lSwitch = logSwitch
185177
_ = checkSaptuneConfigFile(saptuneConf)
186178

187-
//txt = buffer.String()
188-
//checkOut(t, txt, matchTxt)
189179
if tstRetErrorExit != 128 {
190180
t.Errorf("error exit should be '128' and NOT '%v'\n", tstRetErrorExit)
191181
}

ospackage/man/saptune-note.5

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ Supported tags are:
5656
.BI os= <os_version>
5757
to define a special \fIos version\fP
5858
.br
59-
Valid values for \fBos=\fP are the values from the \fBVERSION=\fP line of \fB/etc/os-release\fP, e.g. 12-SP5, 12, 15, 15-SP5 or 16.0
60-
.br
61-
To mark an entire major release the string 12-*, 15-* or 16.* can be used.
62-
.br
63-
Additional there is the possibility to use a list or a range of valid releases (service packs, dot releases)
59+
Valid values for \fBos=\fP must match the value from the \fBVERSION=\fP line of \fB/etc/os-release\fP, e.g. 12-SP5, 12, 15, 15-SP5 or 16.0
60+
61+
If \fBVERSION=\fP contains spaces, only the string until the first space is used for comparison. This excludes any suffixes - like for beta versions - from the comparison.
62+
63+
To mark an entire major release the wildcard \fB*\fP in combination with a separator \fB-\fP or \fB.\fP (regardless of the one present in \fBVERSION\fP) can be used. Valid patterns are: 12-*, 12.*, 15-*, 15.*, 16-* or 16.*
64+
65+
Additional there is the possibility to use a list or a range of valid service packs or dot releases. Again the separator can be \fB-\fP or \fB.\fP (regardless of the one present in \fBVERSION\fP). And for service packs (in 12/15) the \fISP\fP prefix should be omitted.
6466
.br
65-
e.g 15-[2,4-5,6-,-7]
67+
e.g 15-[2,4-5,6-,-7] or 15.[2,4-5,6-,-7]
6668
.TP
6769
.BI arch= <hardware_architecture>
6870
to define a special \fIhardware architecture\fP:
@@ -131,7 +133,9 @@ Example:
131133
.BI virt= <virtualization type>
132134
to define a special \fIvirtualization\fP class or type
133135
.br
134-
Valid class values for \fBvirt=\fP are \fBvm\fP, \fBchroot\fP and \fBcontainer\fP. Valid type values for \fBvirt=\fP are the output reported by \fI/usr/bin/systemd-detect-virt\fP
136+
Valid class values for \fBvirt=\fP are \fBvm\fP, \fBchroot\fP, \fBcontainer\fP and \fBbare-metal\fP.
137+
.br
138+
Valid type values for \fBvirt=\fP are the output reported by \fI/usr/bin/systemd-detect-virt\fP. If no virtualization is detected it's concidered as \fBbare-metal\fP
135139

136140
.RS 4
137141
Example:

ospackage/man/saptune.8

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ ATTENTION: If you still use version \fB1\fP of saptune it's now time to migrate
3030
( start | stop | restart | takeover | enable | disable | enablestart | disablestop | status [--non-compliance-check] )
3131

3232
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBnote\fP
33-
( list | verify | refresh | revertall | enabled | applied )
33+
( list | verify | revertall | enabled | applied )
3434

3535
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBnote\fP
3636
( apply | simulate | customise | create | edit | revert | show | delete ) NOTEID
3737

3838
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBnote\fP
39-
refresh [NOTEID|applied]
39+
refresh [NOTEID|applied] \fBATTENTION: experimental\fP
4040

4141
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBnote\fP
4242
verify [--colorscheme SCHEME] [--show-non-compliant] [NOTEID|applied]
@@ -77,6 +77,9 @@ release [--force|--dry-run] [ ( NOTEID | SOLUTIONNAME.sol )... | all ]
7777
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBverify\fP
7878
applied
7979

80+
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBrefresh\fP
81+
applied \fBATTENTION: experimental\fP
82+
8083
\fBsaptune\fP [--format FORMAT] [--force-color] [--fun] \fBrevert\fP
8184
all
8285

@@ -474,11 +477,13 @@ This allows to create own Note definition files in \fI/etc/saptune/extra\fP. The
474477
The editor is defined by the \fBEDITOR\fP environment variable. If not set editor defaults to /usr/bin/vim.
475478
You need to choose an unique NoteID for this operation. Use '\fIsaptune note list\fP' to find the already used NoteIDs.
476479
.TP
477-
.B refresh
480+
.B refresh \fBATTENTION: experimental\fP
478481
Identifies and activates changed parameter settings of a Note definition. The changes get active without first reverting the 'old' settings, so the tuning of the system gets not interrupted.
479482

480483
ATTENTION:
481484
.br
485+
This action is currently in the state \fBexperimental\fP!
486+
482487
Currently only parameter of section "[sysctl]", "[sys]" and "[vm]" are supported by the \fIrefresh\fP action.
483488

484489
Parameter of section "[version]", "[rpm]", "[grub]", "[fs]" and "[reminder]" are only checked by saptune, but not applied. So there is nothing to do during refresh of a note and these sections are skipped without notice.
@@ -787,7 +792,7 @@ Same as a \fIsaptune note verify\fP
787792

788793
.SH REFRESH ACTIONS
789794
.TP
790-
.B refresh applied
795+
.B refresh applied \fBATTENTION: experimental\fP
791796
Refreshes all applied Notes.
792797
.br
793798
Same as a \fIsaptune note refresh\fP

ospackage/usr/share/saptune/notes/1275776

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ sysctl-logger.service=start
2424
#
2525
vm.max_map_count=2147483647
2626

27+
# kernel.shmmni
28+
# The value is the maximum number of shared memory identifies available in the
29+
# system.
30+
# kernel.shmmni should be set to 32768
31+
#
32+
kernel.shmmni=32768

ospackage/usr/share/saptune/notes/2205917

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ THP=never
3636
#
3737
KSM=0
3838

39-
[cpu:arch=x86_64]
39+
[cpu:arch=x86_64:virt=bare-metal]
4040
# Energy Performance Bias EPB (applies to Intel-based systems only)
4141
# energy_perf_bias: performance - 0, normal - 6, powersave - 15
4242
# cpupower set -b 0, if system supports Intel's performance bias setting
@@ -134,16 +134,17 @@ kernel-default 4.12.14-122.17
134134
# some of these values are set by saptune during runtime, so changing the
135135
# grub configuration is possible but not needed
136136
#
137-
# Configure C-States for lower latency in Linux (applies to Intel-based systems
138-
# only) - see energy_perf_bias and governor in section [cpu]
139-
intel_idle.max_cstate=1
140-
processor.max_cstate=1
141-
142137
# Turn off autoNUMA balancing - see kernel.numa_balancing in section [sysctl]
143138
numa_balancing=disable
144139
# Disable transparent hugepages - see THP in section [vm]
145140
transparent_hugepage=never
146141

142+
[grub:arch=x86_64:virt=bare-metal]
143+
# Configure C-States for lower latency in Linux (applies to Intel-based systems
144+
# only) - see energy_perf_bias and governor in section [cpu]
145+
intel_idle.max_cstate=1
146+
processor.max_cstate=1
147+
147148
[reminder]
148149
# IBM EnergyScale for POWER8 Processor-Based Systems (applies to IBM Power systems only) - not handled by saptune!
149150
# IBM EnergyScale for POWER9 Processor-Based Systems (applies to IBM Power systems only) - not handled by saptune!

0 commit comments

Comments
 (0)