Hi all,
Today's linux-next merge of the tip tree got a conflict in
kernel/trace/trace.c between commit
d304af88a0105ff5b64cffc9108636ecad1fdd78 ("ftrace,kdb: Extend kdb to be
able to dump the ftrace buffer") from the kgdb tree and commit
7e53bd42d14c75192b99674c40fcc359392da59d ("tracing: Consolidate
protection of reader access to the ring buffer") from the tip tree.
Just context changes (I think). I fixed it up (see below) and can carry
the fix as necessary.
--
Cheers,
Stephen Rothwell [email protected]
diff --cc kernel/trace/trace.c
index b3c786a,5314c90..0000000
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@@ -100,11 -101,11 +101,8 @@@ static inline void ftrace_enable_cpu(vo
preempt_enable();
}
-static cpumask_var_t __read_mostly tracing_buffer_mask;
-
-#define for_each_tracing_cpu(cpu) \
- for_each_cpu(cpu, tracing_buffer_mask)
+cpumask_var_t __read_mostly tracing_buffer_mask;
- /* Define which cpu buffers are currently read in trace_pipe */
- static cpumask_var_t tracing_reader_cpumask;
-
/*
* ftrace_dump_on_oops - variable to dump ftrace buffer on oops
*
@@@ -3066,7 -3131,8 +3123,8 @@@ waitagain
iter->pos = -1;
trace_event_read_lock();
+ trace_access_lock(iter->cpu_file);
- while (find_next_entry_inc(iter) != NULL) {
+ while (trace_find_next_entry_inc(iter) != NULL) {
enum print_line_t ret;
int len = iter->seq.len;
* Stephen Rothwell <[email protected]> wrote:
> Hi all,
>
> Today's linux-next merge of the tip tree got a conflict in
> kernel/trace/trace.c between commit
> d304af88a0105ff5b64cffc9108636ecad1fdd78 ("ftrace,kdb: Extend kdb to be
> able to dump the ftrace buffer") from the kgdb tree and commit
> 7e53bd42d14c75192b99674c40fcc359392da59d ("tracing: Consolidate
> protection of reader access to the ring buffer") from the tip tree.
Hm, Jason, what is that large commit to kernel/trace/ doing in the KGDB tree,
without any apparent acks from the affected people?
I dont see it anywhere on lkml nor in my mbox. Please submit it to the
affected maintainers - for the Cc: line see the output of:
scripts/get_maintainer.pl -f kernel/trace/trace.c
Thanks,
Ingo
Ingo Molnar wrote:
> * Stephen Rothwell <[email protected]> wrote:
>
>
>> Hi all,
>>
>> Today's linux-next merge of the tip tree got a conflict in
>> kernel/trace/trace.c between commit
>> d304af88a0105ff5b64cffc9108636ecad1fdd78 ("ftrace,kdb: Extend kdb to be
>> able to dump the ftrace buffer") from the kgdb tree and commit
>> 7e53bd42d14c75192b99674c40fcc359392da59d ("tracing: Consolidate
>> protection of reader access to the ring buffer") from the tip tree.
>>
>
> Hm, Jason, what is that large commit to kernel/trace/ doing in the KGDB tree,
> without any apparent acks from the affected people?
>
I had been corresponding with Steven Rostedt directly. This is actually
the 3rd iteration of the patch (the first two never got checked in
anywhere) and there is still an outstanding question, which I will
inline at the bottom of this email. The ftdump patch is at the very end
of the kdb series, because this patch will get nuked if Steven or anyone
else has a problem with it.
As for what the patch does, it is routine for dumping the ftrace buffer
while in the kernel debugger context.
> I dont see it anywhere on lkml nor in my mbox. Please submit it to the
> affected maintainers - for the Cc: line see the output of:
>
The v2 version of the kdb series was supposed to go out yesterday
morning (also known as kdb_prototype11). The new patch is included in
the post, look for: "[PATCH 40/40] ftrace,kdb: Extend kdb to be able to
dump the ftrace buffer"
-- prior inlined correspondence --
Steven Rostedt wrote:
> > On Tue, 2010-01-05 at 23:57 -0600, Jason Wessel wrote:
>
>> >> Here is another try at adding a dump function for kdb. I had to
>> >> changes some of the static -> global scope in kernel/trace/trace.c in
>> >> order to be able to reference other semi-private via "trace.h".
>>
> >
> > Actually, could you write access functions instead. If we make these
> > items global in scope, then others will just start accessing them
> > directly. I've had this issue before because others have tried to make
> > the global_trace visible by all. But that variable may disappear and
> > break all that use it.
> >
>
Thanks for the insight.
Here is v3.
I added a function called trace_init_global_iter(). I'll rename it if
you like. I also changed the ftrace_dump() to make use of it as well
so we are more likely to see an issue when it changes if there are
more consumers of the function.
The other question it brings up is if you want a helper function for
the atomic_inc / atomic_dec of the tracing cpus. That would move that
for_each_tracing_cpu macro back into trace.c.
Thanks,
Jason.
[..patch clipped..]
On Thu, 2010-01-14 at 09:01 -0600, Jason Wessel wrote:
> Ingo Molnar wrote:
> > * Stephen Rothwell <[email protected]> wrote:
> >
> >
> >> Hi all,
> >>
> >> Today's linux-next merge of the tip tree got a conflict in
> >> kernel/trace/trace.c between commit
> >> d304af88a0105ff5b64cffc9108636ecad1fdd78 ("ftrace,kdb: Extend kdb to be
> >> able to dump the ftrace buffer") from the kgdb tree and commit
> >> 7e53bd42d14c75192b99674c40fcc359392da59d ("tracing: Consolidate
> >> protection of reader access to the ring buffer") from the tip tree.
> >>
> >
> > Hm, Jason, what is that large commit to kernel/trace/ doing in the KGDB tree,
> > without any apparent acks from the affected people?
> >
>
> I had been corresponding with Steven Rostedt directly. This is actually
> the 3rd iteration of the patch (the first two never got checked in
> anywhere) and there is still an outstanding question, which I will
> inline at the bottom of this email. The ftdump patch is at the very end
> of the kdb series, because this patch will get nuked if Steven or anyone
> else has a problem with it.
Yep, we've been talking, I just didn't know it went into a public git
tree yet :-)
>
> As for what the patch does, it is routine for dumping the ftrace buffer
> while in the kernel debugger context.
>
> > I dont see it anywhere on lkml nor in my mbox. Please submit it to the
> > affected maintainers - for the Cc: line see the output of:
> >
>
> The v2 version of the kdb series was supposed to go out yesterday
> morning (also known as kdb_prototype11). The new patch is included in
> the post, look for: "[PATCH 40/40] ftrace,kdb: Extend kdb to be able to
> dump the ftrace buffer"
>
> -- prior inlined correspondence --
>
> Steven Rostedt wrote:
>
> > > On Tue, 2010-01-05 at 23:57 -0600, Jason Wessel wrote:
> >
> >> >> Here is another try at adding a dump function for kdb. I had to
> >> >> changes some of the static -> global scope in kernel/trace/trace.c in
> >> >> order to be able to reference other semi-private via "trace.h".
> >>
> > >
> > > Actually, could you write access functions instead. If we make these
> > > items global in scope, then others will just start accessing them
> > > directly. I've had this issue before because others have tried to make
> > > the global_trace visible by all. But that variable may disappear and
> > > break all that use it.
> > >
> >
>
> Thanks for the insight.
>
> Here is v3.
>
> I added a function called trace_init_global_iter(). I'll rename it if
> you like. I also changed the ftrace_dump() to make use of it as well
> so we are more likely to see an issue when it changes if there are
> more consumers of the function.
>
> The other question it brings up is if you want a helper function for
> the atomic_inc / atomic_dec of the tracing cpus. That would move that
> for_each_tracing_cpu macro back into trace.c.
I think the point Ingo is making, is that the changes to the
kernel/trace directory would best go through the tip tree. This will
ensure that this change does not have any undesirable effects to other
parts of tracing that is being worked on.
There's always an issue with having one subsystem depend on changes in
another subsystem. What I did in the past when PPC needed changes to the
trace directory, was that I made the changes in the trace code directly
against Linus's tree in a separate branch. Then the two git repo's (PPC
and tip) could pull that change in. Which ever one went first to Linus
would get the required change without causing duplicates.
But since this is the last patch in the series, perhaps it can just go
directly into tip?
-- Steve
Steven Rostedt wrote:
>> Steven Rostedt wrote:
>>
>>
>>>> On Tue, 2010-01-05 at 23:57 -0600, Jason Wessel wrote:
>>>>
>>>
>>>
>>>>>> Here is another try at adding a dump function for kdb. I had to
>>>>>> changes some of the static -> global scope in kernel/trace/trace.c in
>>>>>> order to be able to reference other semi-private via "trace.h".
>>>>>>
>>>>
>>>>
>>>> Actually, could you write access functions instead. If we make these
>>>> items global in scope, then others will just start accessing them
>>>> directly. I've had this issue before because others have tried to make
>>>> the global_trace visible by all. But that variable may disappear and
>>>> break all that use it.
>>>>
>>>>
>>>
>>>
>> Thanks for the insight.
>>
>> Here is v3.
>>
>> I added a function called trace_init_global_iter(). I'll rename it if
>> you like. I also changed the ftrace_dump() to make use of it as well
>> so we are more likely to see an issue when it changes if there are
>> more consumers of the function.
>>
>> The other question it brings up is if you want a helper function for
>> the atomic_inc / atomic_dec of the tracing cpus. That would move that
>> for_each_tracing_cpu macro back into trace.c.
>>
>
>
> I think the point Ingo is making, is that the changes to the
> kernel/trace directory would best go through the tip tree. This will
> ensure that this change does not have any undesirable effects to other
> parts of tracing that is being worked on.
>
> There's always an issue with having one subsystem depend on changes in
> another subsystem. What I did in the past when PPC needed changes to the
> trace directory, was that I made the changes in the trace code directly
> against Linus's tree in a separate branch. Then the two git repo's (PPC
> and tip) could pull that change in. Which ever one went first to Linus
> would get the required change without causing duplicates.
>
> But since this is the last patch in the series, perhaps it can just go
> directly into tip?
>
>
It depends if you agree with the changes or not and if this patch is now
in a "ready for merge" state.
The patch is completely self contained and could be merged before or
after the kdb/kgdb change set. If it is merged into tip or a sub
branch, I just need to know the location of preference.
Some of the kms changes have the same problem as this patch, and they
too might move outside the public kernel debugger git tree.
Thanks,
Jason.