lkml.org 
[lkml]   [2009]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/4][RFC] perf_counter: Allow sharing of output channels
From
Date
On Wed, 2009-08-19 at 18:19 +0200, Frederic Weisbecker wrote:
> On Wed, Aug 19, 2009 at 11:18:27AM +0200, Peter Zijlstra wrote:
> > Provide the ability to configure a counter to send its output to
> > another (already existing) counter's output stream.
> >
> > [ compile tested only ]
> >
> > Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> > Cc: stephane eranian <eranian@googlemail.com>
> > +int perf_counter_set_output(struct perf_counter *counter, int output_fd)
> > +{
> > + struct perf_counter *output_counter = NULL;
> > + struct file *output_file = NULL;
> > + struct perf_counter *old_output;
> > + int fput_needed = 0;
> > + int ret = -EINVAL;
> > +
> > + if (!output_fd)
> > + goto set;
> > +
> > + output_file = fget_light(output_fd, &fput_needed);
> > + if (!output_file)
> > + return -EBADF;
> > +
> > + if (output_file->f_op != &perf_fops)
> > + goto out;
> > +
> > + output_counter = output_file->private_data;
> > +
> > + /* Don't chain output fds */
> > + if (output_counter->output)
> > + goto out;
>
>
>
> If you don't chain them, how do you propagate more than one
> path of output redirected?

you mean, fd2->fd1->fd0 ?

You don't, that sounds like a silly thing to do, do fd1->fd0, fd2->fd0
instead.



\
 
 \ /
  Last update: 2009-08-19 18:27    [W:0.133 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site