From: tip-bot for Arnaldo Carvalho de Melo <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, jolsa@kernel.org, hpa@zytor.com,
wangnan0@huawei.com, tglx@linutronix.de, adrian.hunter@intel.com,
namhyung@kernel.org, acme@redhat.com, eranian@google.com,
mingo@kernel.org, dsahern@gmail.com
Subject: [tip:perf/core] perf cgroup: Introduce cgroup__delete()
Date: Fri, 9 Mar 2018 00:34:49 -0800 [thread overview]
Message-ID: <tip-j3j72vvn2d5j7tenlghdy195@git.kernel.org> (raw)
Commit-ID: 9450d0d46c895cae99e922145aca20bd30533bc6
Gitweb: https://git.kernel.org/tip/9450d0d46c895cae99e922145aca20bd30533bc6
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Tue, 6 Mar 2018 10:08:10 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 7 Mar 2018 10:22:25 -0300
perf cgroup: Introduce cgroup__delete()
Just to make this code look more like other places in tools/perf.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-j3j72vvn2d5j7tenlghdy195@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/cgroup.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c
index 6ce291f45f2d..4dd52feb1ae6 100644
--- a/tools/perf/util/cgroup.c
+++ b/tools/perf/util/cgroup.c
@@ -144,12 +144,17 @@ found:
return 0;
}
+static void cgroup__delete(struct cgroup *cgroup)
+{
+ close(cgroup->fd);
+ zfree(&cgroup->name);
+ free(cgroup);
+}
+
void close_cgroup(struct cgroup *cgrp)
{
if (cgrp && refcount_dec_and_test(&cgrp->refcnt)) {
- close(cgrp->fd);
- zfree(&cgrp->name);
- free(cgrp);
+ cgroup__delete(cgrp);
}
}
reply other threads:[~2018-03-09 8:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=tip-j3j72vvn2d5j7tenlghdy195@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
--cc=wangnan0@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).