On 10/11/2013 08:42 AM, Ivana Varekova wrote: > > > ----- Original Message ----- >> From: "Peter Schiffer" <pschi...@redhat.com> >> To: libcg-devel@lists.sourceforge.net >> Sent: Tuesday, October 8, 2013 7:17:48 PM >> Subject: [Libcg-devel] [PATCH 2/2] Template expanding to process name does >> not work >> >> %p template doesn't work, because it's expanding to the full path of binary >> file. With this patch, %p template is expanded to the base name of binary >> file. > > Hello, > I don't like the fact binaries which has different path and are called using > the full path ar eput to the same cgroup. > Dhaval please what is your opinion regarding this patch? > Ivana
Hi, this description is accurate. When I was thinking about it, I came to the conclusion that this is not very common, and complicating the code is not worth it. Another simple solution can be to replace '/' with '_' in binary path for example, what would require additional function, probably in api.c file. It's up to you, I'm willing to do the change, if you consider it necessary. peter >> >> Signed-off-by: Peter Schiffer <pschi...@redhat.com> >> --- >> src/api.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/src/api.c b/src/api.c >> index 0e4601b..183f387 100644 >> --- a/src/api.c >> +++ b/src/api.c >> @@ -2966,10 +2966,10 @@ int cgroup_change_cgroup_flags(uid_t uid, gid_t gid, >> available, "%d", pid); >> break; >> case 'p': >> - if(procname) { >> + if(procname && >> strlen(basename(procname))) { >> written = snprintf(newdest + j, >> available, "%s", >> - procname); >> + basename(procname)); >> } else { >> written = snprintf(newdest + j, >> available, "%d", pid); >> >> >> ------------------------------------------------------------------------------ >> October Webinars: Code for Performance >> Free Intel webinars can help you accelerate application performance. >> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from >> the latest Intel processors and coprocessors. See abstracts and register > >> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk >> _______________________________________________ >> Libcg-devel mailing list >> Libcg-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/libcg-devel >> ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel