max sample rate optimization

Signed-off-by: yuyanqinghw <yuyanqing539@huawei.com>
This commit is contained in:
yuyanqinghw 2024-01-30 19:33:56 +08:00
parent 29a2f3d80a
commit 81e3301718

View File

@ -754,11 +754,9 @@ void PerfEvents::SetSampleFrequency(unsigned int frequency)
printf("read perf_event_max_sample_rate fail.\n");
return;
}
if (sampleFreq_ > maxRate)
{
if (sampleFreq_ > maxRate) {
sampleFreq_ = maxRate;
if (!printFlag)
{
if (!printFlag) {
printf("Adjust sampling frequency to maximum allowed frequency %d.\n", maxRate);
printFlag = true;
}