mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ravi Bangoria <ravi.bangoria@amd.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: peterz@infradead.org, eranian@google.com, acme@kernel.org,
	mark.rutland@arm.com, jolsa@kernel.org, irogers@google.com,
	bp@alien8.de, x86@kernel.org, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org, sandipan.das@amd.com,
	ananth.narayan@amd.com, santosh.shukla@amd.com,
	Ravi Bangoria <ravi.bangoria@amd.com>
Subject: Re: [PATCH 2/2] perf test: Add selftest to test IBS invocation via core pmu events
Date: Fri, 3 Mar 2023 11:25:13 +0530	[thread overview]
Message-ID: <2075986d-2344-80ff-d494-8bdc97b627d5@amd.com> (raw)
In-Reply-To: <CAM9d7chQA27aD_mPe=3-9jZLWP_a64ztihuK=upgNL++kMFSNw@mail.gmail.com>

Hi Namhyung,

>> +static int test__ibs_via_core_pmu(struct test_suite *text __maybe_unused,
>> +                                 int subtest __maybe_unused)
>> +{
>> +       struct perf_pmu *ibs_pmu;
>> +       int ret = TEST_OK;
>> +       int fd, i;
>> +
>> +       if (list_empty(&pmus))
>> +               perf_pmu__scan(NULL);
>> +
>> +       ibs_pmu = perf_pmu__find("ibs_op");
>> +       if (!ibs_pmu)
>> +               return TEST_SKIP;
>> +
>> +       for (i = 0; i < NR_SUB_TESTS; i++) {
>> +               fd = event_open(sub_tests[i].type, sub_tests[i].config);
>> +               pr_debug("type: 0x%x, config: 0x%lx, fd: %d  -  ", sub_tests[i].type,
>> +                        sub_tests[i].config, fd);
>> +               if ((sub_tests[i].valid && fd == -1) ||
>> +                   (!sub_tests[i].valid && fd > 0)) {
>> +                       pr_debug("Fail\n");
>> +                       ret = TEST_FAIL;
> 
> You need to close(fd) when it's succeeded for invalid one.

Yup. Will fix it.

Thanks,
Ravi

      reply	other threads:[~2023-03-03  5:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02  9:21 [PATCH 0/2] perf/ibs: Fix interface " Ravi Bangoria
2023-03-02  9:21 ` [PATCH 1/2] " Ravi Bangoria
2023-03-02 22:10   ` Namhyung Kim
2023-03-03  5:54     ` Ravi Bangoria
2023-03-06 22:29       ` Namhyung Kim
2023-03-07  3:19         ` Ravi Bangoria
2023-03-02  9:21 ` [PATCH 2/2] perf test: Add selftest to test IBS invocation " Ravi Bangoria
2023-03-02 22:12   ` Namhyung Kim
2023-03-03  5:55     ` Ravi Bangoria [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2075986d-2344-80ff-d494-8bdc97b627d5@amd.com \
    --to=ravi.bangoria@amd.com \
    --cc=acme@kernel.org \
    --cc=ananth.narayan@amd.com \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sandipan.das@amd.com \
    --cc=santosh.shukla@amd.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®