* [PATCH] perf test: Restore sample rate for perf_event_attr
@ 2024-08-28 13:46 vmolnaro
2024-10-01 8:31 ` Veronika Molnarova
0 siblings, 1 reply; 6+ messages in thread
From: vmolnaro @ 2024-08-28 13:46 UTC (permalink / raw)
To: linux-perf-users, acme, acme
Cc: mpetlan, rstoyano, mark.rutland, kan.liang, jolsa, irogers,
alexander.shishkin, adrian.hunter
From: Veronika Molnarova <vmolnaro@redhat.com>
Test "Setup struct perf_event_attr" consists of multiple test cases that
can affect the max sample rate value for perf events. Some test cases
check this value as it should not be lowered under the set minimum for
the given test. Currently, it is possible for the test cases to affect
each other as the previous tests can lower the sample rate, leading to
a possible failure of some of the future test cases as the value is not
restored at any point.
10: Setup struct perf_event_attr:
--- start ---
test child forked, pid 104220
Using CPUID 0x00000000413fd0c1
running './tests/attr/test-record-C0'
Current sample rate: 10000
running './tests/attr/test-record-basic'
Current sample rate: 900
running './tests/attr/test-record-branch-any'
Current sample rate: 600
running './tests/attr/test-record-dummy-C0'
Current sample rate: 600
expected sample_period=4000, got 600
FAILED './tests/attr/test-record-dummy-C0' - match failure
Restore the max sample rate value for perf events to a reasonable value
before each test case if its value was lowered too much to ensure the
same conditions for each test case.
10: Setup struct perf_event_attr:
--- start ---
test child forked, pid 107222
Using CPUID 0x00000000413fd0c1
running './tests/attr/test-record-C0'
Current sample rate: 10000
running './tests/attr/test-record-basic'
Current sample rate: 800
running './tests/attr/test-record-branch-any'
Current sample rate: 700
unsupp './tests/attr/test-record-branch-any'
running './tests/attr/test-record-branch-filter-any'
Current sample rate: 10000
running './tests/attr/test-record-count'
Current sample rate: 10000
running './tests/attr/test-record-data'
Current sample rate: 600
running './tests/attr/test-record-dummy-C0'
Current sample rate: 800
running './tests/attr/test-record-freq'
Current sample rate: 10000
...
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Radostin Stoyanov <rstoyano@redhat.com>
Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
---
tools/perf/tests/attr.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py
index e890c261ad26..3db9a7d78715 100644
--- a/tools/perf/tests/attr.py
+++ b/tools/perf/tests/attr.py
@@ -246,6 +246,23 @@ class Test(object):
return False
return True
+ def restore_sample_rate(self, value=10000):
+ try:
+ # Check value of sample_rate
+ with open("/proc/sys/kernel/perf_event_max_sample_rate", "r") as fIn:
+ curr_value = fIn.readline()
+ # If too low restore to reasonable value
+ if not curr_value or int(curr_value) < int(value):
+ with open("/proc/sys/kernel/perf_event_max_sample_rate", "w") as fOut:
+ fOut.write(str(value))
+
+ except IOError as e:
+ log.warning("couldn't restore sample_rate value: I/O error %s" % e)
+ except ValueError as e:
+ log.warning("couldn't restore sample_rate value: Value error %s" % e)
+ except TypeError as e:
+ log.warning("couldn't restore sample_rate value: Type error %s" % e)
+
def load_events(self, path, events):
parser_event = configparser.ConfigParser()
parser_event.read(path)
@@ -283,6 +300,7 @@ class Test(object):
if self.skip_test_kernel_until():
raise Notest(self, "new kernel skip")
+ self.restore_sample_rate()
cmd = "PERF_TEST_ATTR=%s %s %s -o %s/perf.data %s" % (tempdir,
self.perf, self.command, tempdir, self.args)
ret = os.WEXITSTATUS(os.system(cmd))
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] perf test: Restore sample rate for perf_event_attr
2024-08-28 13:46 [PATCH] perf test: Restore sample rate for perf_event_attr vmolnaro
@ 2024-10-01 8:31 ` Veronika Molnarova
2024-10-02 0:19 ` Namhyung Kim
0 siblings, 1 reply; 6+ messages in thread
From: Veronika Molnarova @ 2024-10-01 8:31 UTC (permalink / raw)
To: linux-perf-users, acme, acme
Cc: mpetlan, rstoyano, mark.rutland, kan.liang, jolsa, irogers,
alexander.shishkin, adrian.hunter
Ping
On 8/28/24 15:46, vmolnaro@redhat.com wrote:
> From: Veronika Molnarova <vmolnaro@redhat.com>
>
> Test "Setup struct perf_event_attr" consists of multiple test cases that
> can affect the max sample rate value for perf events. Some test cases
> check this value as it should not be lowered under the set minimum for
> the given test. Currently, it is possible for the test cases to affect
> each other as the previous tests can lower the sample rate, leading to
> a possible failure of some of the future test cases as the value is not
> restored at any point.
>
> 10: Setup struct perf_event_attr:
> --- start ---
> test child forked, pid 104220
> Using CPUID 0x00000000413fd0c1
> running './tests/attr/test-record-C0'
> Current sample rate: 10000
> running './tests/attr/test-record-basic'
> Current sample rate: 900
> running './tests/attr/test-record-branch-any'
> Current sample rate: 600
> running './tests/attr/test-record-dummy-C0'
> Current sample rate: 600
> expected sample_period=4000, got 600
> FAILED './tests/attr/test-record-dummy-C0' - match failure
>
> Restore the max sample rate value for perf events to a reasonable value
> before each test case if its value was lowered too much to ensure the
> same conditions for each test case.
>
> 10: Setup struct perf_event_attr:
> --- start ---
> test child forked, pid 107222
> Using CPUID 0x00000000413fd0c1
> running './tests/attr/test-record-C0'
> Current sample rate: 10000
> running './tests/attr/test-record-basic'
> Current sample rate: 800
> running './tests/attr/test-record-branch-any'
> Current sample rate: 700
> unsupp './tests/attr/test-record-branch-any'
> running './tests/attr/test-record-branch-filter-any'
> Current sample rate: 10000
> running './tests/attr/test-record-count'
> Current sample rate: 10000
> running './tests/attr/test-record-data'
> Current sample rate: 600
> running './tests/attr/test-record-dummy-C0'
> Current sample rate: 800
> running './tests/attr/test-record-freq'
> Current sample rate: 10000
> ...
>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Kan Liang <kan.liang@linux.intel.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Michael Petlan <mpetlan@redhat.com>
> Cc: Radostin Stoyanov <rstoyano@redhat.com>
> Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
> ---
> tools/perf/tests/attr.py | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py
> index e890c261ad26..3db9a7d78715 100644
> --- a/tools/perf/tests/attr.py
> +++ b/tools/perf/tests/attr.py
> @@ -246,6 +246,23 @@ class Test(object):
> return False
> return True
>
> + def restore_sample_rate(self, value=10000):
> + try:
> + # Check value of sample_rate
> + with open("/proc/sys/kernel/perf_event_max_sample_rate", "r") as fIn:
> + curr_value = fIn.readline()
> + # If too low restore to reasonable value
> + if not curr_value or int(curr_value) < int(value):
> + with open("/proc/sys/kernel/perf_event_max_sample_rate", "w") as fOut:
> + fOut.write(str(value))
> +
> + except IOError as e:
> + log.warning("couldn't restore sample_rate value: I/O error %s" % e)
> + except ValueError as e:
> + log.warning("couldn't restore sample_rate value: Value error %s" % e)
> + except TypeError as e:
> + log.warning("couldn't restore sample_rate value: Type error %s" % e)
> +
> def load_events(self, path, events):
> parser_event = configparser.ConfigParser()
> parser_event.read(path)
> @@ -283,6 +300,7 @@ class Test(object):
> if self.skip_test_kernel_until():
> raise Notest(self, "new kernel skip")
>
> + self.restore_sample_rate()
> cmd = "PERF_TEST_ATTR=%s %s %s -o %s/perf.data %s" % (tempdir,
> self.perf, self.command, tempdir, self.args)
> ret = os.WEXITSTATUS(os.system(cmd))
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] perf test: Restore sample rate for perf_event_attr
2024-10-01 8:31 ` Veronika Molnarova
@ 2024-10-02 0:19 ` Namhyung Kim
2024-10-03 12:51 ` [PATCH v2] " vmolnaro
2024-10-03 12:56 ` [PATCH] " Veronika Molnarova
0 siblings, 2 replies; 6+ messages in thread
From: Namhyung Kim @ 2024-10-02 0:19 UTC (permalink / raw)
To: Veronika Molnarova
Cc: linux-perf-users, acme, acme, mpetlan, rstoyano, mark.rutland,
kan.liang, jolsa, irogers, alexander.shishkin, adrian.hunter
Hello,
On Tue, Oct 01, 2024 at 10:31:38AM +0200, Veronika Molnarova wrote:
> Ping
>
> On 8/28/24 15:46, vmolnaro@redhat.com wrote:
> > From: Veronika Molnarova <vmolnaro@redhat.com>
> >
> > Test "Setup struct perf_event_attr" consists of multiple test cases that
> > can affect the max sample rate value for perf events. Some test cases
> > check this value as it should not be lowered under the set minimum for
> > the given test. Currently, it is possible for the test cases to affect
> > each other as the previous tests can lower the sample rate, leading to
> > a possible failure of some of the future test cases as the value is not
> > restored at any point.
> >
> > 10: Setup struct perf_event_attr:
> > --- start ---
> > test child forked, pid 104220
> > Using CPUID 0x00000000413fd0c1
> > running './tests/attr/test-record-C0'
> > Current sample rate: 10000
> > running './tests/attr/test-record-basic'
> > Current sample rate: 900
> > running './tests/attr/test-record-branch-any'
> > Current sample rate: 600
> > running './tests/attr/test-record-dummy-C0'
> > Current sample rate: 600
> > expected sample_period=4000, got 600
> > FAILED './tests/attr/test-record-dummy-C0' - match failure
Please indent the shell output or source code by at least 2 spaces so
that git can distinguish it from other messages. Typical problems are
having '#' at the beginning of a line.
In this case, '---' in the test output makes it think the rest is a
comment and ignored the messages.
Can you please resend with the change?
Thanks,
Namhyung
> >
> > Restore the max sample rate value for perf events to a reasonable value
> > before each test case if its value was lowered too much to ensure the
> > same conditions for each test case.
> >
> > 10: Setup struct perf_event_attr:
> > --- start ---
> > test child forked, pid 107222
> > Using CPUID 0x00000000413fd0c1
> > running './tests/attr/test-record-C0'
> > Current sample rate: 10000
> > running './tests/attr/test-record-basic'
> > Current sample rate: 800
> > running './tests/attr/test-record-branch-any'
> > Current sample rate: 700
> > unsupp './tests/attr/test-record-branch-any'
> > running './tests/attr/test-record-branch-filter-any'
> > Current sample rate: 10000
> > running './tests/attr/test-record-count'
> > Current sample rate: 10000
> > running './tests/attr/test-record-data'
> > Current sample rate: 600
> > running './tests/attr/test-record-dummy-C0'
> > Current sample rate: 800
> > running './tests/attr/test-record-freq'
> > Current sample rate: 10000
> > ...
> >
> > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> > Cc: Ian Rogers <irogers@google.com>
> > Cc: Jiri Olsa <jolsa@kernel.org>
> > Cc: Kan Liang <kan.liang@linux.intel.com>
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: Michael Petlan <mpetlan@redhat.com>
> > Cc: Radostin Stoyanov <rstoyano@redhat.com>
> > Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
> > ---
> > tools/perf/tests/attr.py | 18 ++++++++++++++++++
> > 1 file changed, 18 insertions(+)
> >
> > diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py
> > index e890c261ad26..3db9a7d78715 100644
> > --- a/tools/perf/tests/attr.py
> > +++ b/tools/perf/tests/attr.py
> > @@ -246,6 +246,23 @@ class Test(object):
> > return False
> > return True
> >
> > + def restore_sample_rate(self, value=10000):
> > + try:
> > + # Check value of sample_rate
> > + with open("/proc/sys/kernel/perf_event_max_sample_rate", "r") as fIn:
> > + curr_value = fIn.readline()
> > + # If too low restore to reasonable value
> > + if not curr_value or int(curr_value) < int(value):
> > + with open("/proc/sys/kernel/perf_event_max_sample_rate", "w") as fOut:
> > + fOut.write(str(value))
> > +
> > + except IOError as e:
> > + log.warning("couldn't restore sample_rate value: I/O error %s" % e)
> > + except ValueError as e:
> > + log.warning("couldn't restore sample_rate value: Value error %s" % e)
> > + except TypeError as e:
> > + log.warning("couldn't restore sample_rate value: Type error %s" % e)
> > +
> > def load_events(self, path, events):
> > parser_event = configparser.ConfigParser()
> > parser_event.read(path)
> > @@ -283,6 +300,7 @@ class Test(object):
> > if self.skip_test_kernel_until():
> > raise Notest(self, "new kernel skip")
> >
> > + self.restore_sample_rate()
> > cmd = "PERF_TEST_ATTR=%s %s %s -o %s/perf.data %s" % (tempdir,
> > self.perf, self.command, tempdir, self.args)
> > ret = os.WEXITSTATUS(os.system(cmd))
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] perf test: Restore sample rate for perf_event_attr
2024-10-02 0:19 ` Namhyung Kim
@ 2024-10-03 12:51 ` vmolnaro
2024-10-04 19:29 ` Namhyung Kim
2024-10-03 12:56 ` [PATCH] " Veronika Molnarova
1 sibling, 1 reply; 6+ messages in thread
From: vmolnaro @ 2024-10-03 12:51 UTC (permalink / raw)
To: linux-perf-users, acme, acme
Cc: mpetlan, adrian.hunter, alexander.shishkin, irogers, jolsa,
kan.liang, mark.rutland
From: Veronika Molnarova <vmolnaro@redhat.com>
Test "Setup struct perf_event_attr" consists of multiple test cases that
can affect the max sample rate value for perf events. Some test cases
check this value as it should not be lowered under the set minimum for
the given test. Currently, it is possible for the test cases to affect
each other as the previous tests can lower the sample rate, leading to
a possible failure of some of the future test cases as the value is not
restored at any point.
# 10: Setup struct perf_event_attr:
--- start ---
test child forked, pid 104220
Using CPUID 0x00000000413fd0c1
running './tests/attr/test-record-C0'
Current sample rate: 10000
running './tests/attr/test-record-basic'
Current sample rate: 900
running './tests/attr/test-record-branch-any'
Current sample rate: 600
running './tests/attr/test-record-dummy-C0'
Current sample rate: 600
expected sample_period=4000, got 600
FAILED './tests/attr/test-record-dummy-C0' - match failure
Restore the max sample rate value for perf events to a reasonable value
before each test case if its value was lowered too much to ensure the
same conditions for each test case.
# 10: Setup struct perf_event_attr:
--- start ---
test child forked, pid 107222
Using CPUID 0x00000000413fd0c1
running './tests/attr/test-record-C0'
Current sample rate: 10000
running './tests/attr/test-record-basic'
Current sample rate: 800
running './tests/attr/test-record-branch-any'
Current sample rate: 700
unsupp './tests/attr/test-record-branch-any'
running './tests/attr/test-record-branch-filter-any'
Current sample rate: 10000
running './tests/attr/test-record-count'
Current sample rate: 10000
running './tests/attr/test-record-data'
Current sample rate: 600
running './tests/attr/test-record-dummy-C0'
Current sample rate: 800
running './tests/attr/test-record-freq'
Current sample rate: 10000
...
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Radostin Stoyanov <rstoyano@redhat.com>
Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
---
tools/perf/tests/attr.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py
index e890c261ad2695d8..3db9a7d78715f1d9 100644
--- a/tools/perf/tests/attr.py
+++ b/tools/perf/tests/attr.py
@@ -246,6 +246,23 @@ class Test(object):
return False
return True
+ def restore_sample_rate(self, value=10000):
+ try:
+ # Check value of sample_rate
+ with open("/proc/sys/kernel/perf_event_max_sample_rate", "r") as fIn:
+ curr_value = fIn.readline()
+ # If too low restore to reasonable value
+ if not curr_value or int(curr_value) < int(value):
+ with open("/proc/sys/kernel/perf_event_max_sample_rate", "w") as fOut:
+ fOut.write(str(value))
+
+ except IOError as e:
+ log.warning("couldn't restore sample_rate value: I/O error %s" % e)
+ except ValueError as e:
+ log.warning("couldn't restore sample_rate value: Value error %s" % e)
+ except TypeError as e:
+ log.warning("couldn't restore sample_rate value: Type error %s" % e)
+
def load_events(self, path, events):
parser_event = configparser.ConfigParser()
parser_event.read(path)
@@ -283,6 +300,7 @@ class Test(object):
if self.skip_test_kernel_until():
raise Notest(self, "new kernel skip")
+ self.restore_sample_rate()
cmd = "PERF_TEST_ATTR=%s %s %s -o %s/perf.data %s" % (tempdir,
self.perf, self.command, tempdir, self.args)
ret = os.WEXITSTATUS(os.system(cmd))
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] perf test: Restore sample rate for perf_event_attr
2024-10-02 0:19 ` Namhyung Kim
2024-10-03 12:51 ` [PATCH v2] " vmolnaro
@ 2024-10-03 12:56 ` Veronika Molnarova
1 sibling, 0 replies; 6+ messages in thread
From: Veronika Molnarova @ 2024-10-03 12:56 UTC (permalink / raw)
To: Namhyung Kim
Cc: linux-perf-users, acme, acme, mpetlan, rstoyano, mark.rutland,
kan.liang, jolsa, irogers, alexander.shishkin, adrian.hunter
On 10/2/24 02:19, Namhyung Kim wrote:
> Hello,
>
> On Tue, Oct 01, 2024 at 10:31:38AM +0200, Veronika Molnarova wrote:
>> Ping
>>
>> On 8/28/24 15:46, vmolnaro@redhat.com wrote:
>>> From: Veronika Molnarova <vmolnaro@redhat.com>
>>>
>>> Test "Setup struct perf_event_attr" consists of multiple test cases that
>>> can affect the max sample rate value for perf events. Some test cases
>>> check this value as it should not be lowered under the set minimum for
>>> the given test. Currently, it is possible for the test cases to affect
>>> each other as the previous tests can lower the sample rate, leading to
>>> a possible failure of some of the future test cases as the value is not
>>> restored at any point.
>>>
>>> 10: Setup struct perf_event_attr:
>>> --- start ---
>>> test child forked, pid 104220
>>> Using CPUID 0x00000000413fd0c1
>>> running './tests/attr/test-record-C0'
>>> Current sample rate: 10000
>>> running './tests/attr/test-record-basic'
>>> Current sample rate: 900
>>> running './tests/attr/test-record-branch-any'
>>> Current sample rate: 600
>>> running './tests/attr/test-record-dummy-C0'
>>> Current sample rate: 600
>>> expected sample_period=4000, got 600
>>> FAILED './tests/attr/test-record-dummy-C0' - match failure
>
> Please indent the shell output or source code by at least 2 spaces so
> that git can distinguish it from other messages. Typical problems are
> having '#' at the beginning of a line.
>
> In this case, '---' in the test output makes it think the rest is a
> comment and ignored the messages.
>
> Can you please resend with the change?
Thanks for letting me know, will resend the patch.
Thanks,
Veronika
>
> Thanks,
> Namhyung
>
>>>
>>> Restore the max sample rate value for perf events to a reasonable value
>>> before each test case if its value was lowered too much to ensure the
>>> same conditions for each test case.
>>>
>>> 10: Setup struct perf_event_attr:
>>> --- start ---
>>> test child forked, pid 107222
>>> Using CPUID 0x00000000413fd0c1
>>> running './tests/attr/test-record-C0'
>>> Current sample rate: 10000
>>> running './tests/attr/test-record-basic'
>>> Current sample rate: 800
>>> running './tests/attr/test-record-branch-any'
>>> Current sample rate: 700
>>> unsupp './tests/attr/test-record-branch-any'
>>> running './tests/attr/test-record-branch-filter-any'
>>> Current sample rate: 10000
>>> running './tests/attr/test-record-count'
>>> Current sample rate: 10000
>>> running './tests/attr/test-record-data'
>>> Current sample rate: 600
>>> running './tests/attr/test-record-dummy-C0'
>>> Current sample rate: 800
>>> running './tests/attr/test-record-freq'
>>> Current sample rate: 10000
>>> ...
>>>
>>> Cc: Adrian Hunter <adrian.hunter@intel.com>
>>> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
>>> Cc: Ian Rogers <irogers@google.com>
>>> Cc: Jiri Olsa <jolsa@kernel.org>
>>> Cc: Kan Liang <kan.liang@linux.intel.com>
>>> Cc: Mark Rutland <mark.rutland@arm.com>
>>> Cc: Michael Petlan <mpetlan@redhat.com>
>>> Cc: Radostin Stoyanov <rstoyano@redhat.com>
>>> Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
>>> ---
>>> tools/perf/tests/attr.py | 18 ++++++++++++++++++
>>> 1 file changed, 18 insertions(+)
>>>
>>> diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py
>>> index e890c261ad26..3db9a7d78715 100644
>>> --- a/tools/perf/tests/attr.py
>>> +++ b/tools/perf/tests/attr.py
>>> @@ -246,6 +246,23 @@ class Test(object):
>>> return False
>>> return True
>>>
>>> + def restore_sample_rate(self, value=10000):
>>> + try:
>>> + # Check value of sample_rate
>>> + with open("/proc/sys/kernel/perf_event_max_sample_rate", "r") as fIn:
>>> + curr_value = fIn.readline()
>>> + # If too low restore to reasonable value
>>> + if not curr_value or int(curr_value) < int(value):
>>> + with open("/proc/sys/kernel/perf_event_max_sample_rate", "w") as fOut:
>>> + fOut.write(str(value))
>>> +
>>> + except IOError as e:
>>> + log.warning("couldn't restore sample_rate value: I/O error %s" % e)
>>> + except ValueError as e:
>>> + log.warning("couldn't restore sample_rate value: Value error %s" % e)
>>> + except TypeError as e:
>>> + log.warning("couldn't restore sample_rate value: Type error %s" % e)
>>> +
>>> def load_events(self, path, events):
>>> parser_event = configparser.ConfigParser()
>>> parser_event.read(path)
>>> @@ -283,6 +300,7 @@ class Test(object):
>>> if self.skip_test_kernel_until():
>>> raise Notest(self, "new kernel skip")
>>>
>>> + self.restore_sample_rate()
>>> cmd = "PERF_TEST_ATTR=%s %s %s -o %s/perf.data %s" % (tempdir,
>>> self.perf, self.command, tempdir, self.args)
>>> ret = os.WEXITSTATUS(os.system(cmd))
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] perf test: Restore sample rate for perf_event_attr
2024-10-03 12:51 ` [PATCH v2] " vmolnaro
@ 2024-10-04 19:29 ` Namhyung Kim
0 siblings, 0 replies; 6+ messages in thread
From: Namhyung Kim @ 2024-10-04 19:29 UTC (permalink / raw)
To: linux-perf-users, acme, acme, vmolnaro
Cc: mpetlan, adrian.hunter, alexander.shishkin, irogers, jolsa,
kan.liang, mark.rutland
On Thu, 03 Oct 2024 14:51:36 +0200, vmolnaro@redhat.com wrote:
> Test "Setup struct perf_event_attr" consists of multiple test cases that
> can affect the max sample rate value for perf events. Some test cases
> check this value as it should not be lowered under the set minimum for
> the given test. Currently, it is possible for the test cases to affect
> each other as the previous tests can lower the sample rate, leading to
> a possible failure of some of the future test cases as the value is not
> restored at any point.
>
> [...]
Applied to perf-tools-next, thanks!
Best regards,
Namhyung
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-10-04 19:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 13:46 [PATCH] perf test: Restore sample rate for perf_event_attr vmolnaro
2024-10-01 8:31 ` Veronika Molnarova
2024-10-02 0:19 ` Namhyung Kim
2024-10-03 12:51 ` [PATCH v2] " vmolnaro
2024-10-04 19:29 ` Namhyung Kim
2024-10-03 12:56 ` [PATCH] " Veronika Molnarova
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).