Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>,
	Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH 1/7] trace-cmd: Move trace-output.c into the library code
Date: Fri, 9 Aug 2019 09:59:07 -0400
Message-ID: <20190809095907.429e47b5@gandalf.local.home> (raw)
In-Reply-To: <CACqStocrJeq70HKFbb_epyQMV1xdtaJ2ywm77uf5ht22KAp0cw@mail.gmail.com>

On Fri, 9 Aug 2019 13:22:29 +0000
Tzvetomir Stoyanov <tstoyanov@vmware.com> wrote:

> > > +$(TC_VERSION): force | $(bdir)/include
> > > +     $(Q)$(call update_version.h)
> > > +  
> >
> > Hi Ceco,
> >
> > Why the addition of TC_VERISON here? It's not stated in the change log
> > to why this was copied over. I ever removed all references from
> > TC_VERSION and it still builds fine.
> >
> > -- Steve
> >  
> There is a dependency: trace-output.c includes version.h, which
> includes tc_version.h.
> When trace-output.c is moved to the lib/trace-cmd directory, it
> includes tc_version.h from
> lib/trace-cmd/include. It makes sense, otherwise the libtracecmd will
> depend on the trace-cmd
> application. That's why I duplicated that TC_VERISON logic in
> lib/trace-cmd/Makefile. It
> forces lib/trace-cmd/include/tc_version.h to be generated on every
> libtracecmd build.

Yeah, we can't have that.

> Now we have two auto generated files:
>     lib/trace-cmd/include/tc_version.h
>     tracecmd/include/tc_version.h
> 
> May be we should move tc_version.h to be generated in include/, so we
> can use the same file from
> both the application and the library ?

I looked at why we have version.h there, and it's to get
FILE_VERSION_STRING, which is only used in trace-output.c.

And this is created via the Makefile. Hmm, we may need to move all the
file version logic into lib/trace-event as the only files that should
ever care about this is trace-output.c and trace-input.c, which are
both in the lib/trace-event (not something trace-cmd should worry
about).

-- Steve


> 
> >  
> > >  $(bdir)/libtracecmd.a: $(OBJS)
> > >       $(Q)$(call do_build_static_lib)
> > >
> > > @@ -43,6 +49,8 @@ $(bdir)/trace-util.o: $(obj)/plugins/trace_plugin_dir
> > >  $(DEPS): $(bdir)/.%.d: %.c
> > >       $(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@
> > >
> > > +$(DEPS): $(TC_VERSION)
> > > +
> > >  $(OBJS): $(bdir)/%.o : $(bdir)/.%.d
> > >
> > >  dep_includes := $(wildcard $(DEPS))
> > > @@ -54,4 +62,5 @@ endif
> > >  clean:
> > >       $(RM) $(bdir)/*.a $(bdir)/*.so $(bdir)/*.o $(bdir)/.*.d
> > >
> > > +force:
> > >  .PHONY: clean
> > > diff --git a/tracecmd/trace-output.c b/lib/trace-cmd/trace-output.c
> > > similarity index 100%
> > > rename from tracecmd/trace-output.c
> > > rename to lib/trace-cmd/trace-output.c
> > > diff --git a/tracecmd/Makefile b/tracecmd/Makefile
> > > index bcd437a..6968f83 100644
> > > --- a/tracecmd/Makefile
> > > +++ b/tracecmd/Makefile
> > > @@ -29,7 +29,6 @@ TRACE_CMD_OBJS += trace-restore.o
> > >  TRACE_CMD_OBJS += trace-check-events.o
> > >  TRACE_CMD_OBJS += trace-show.o
> > >  TRACE_CMD_OBJS += trace-list.o
> > > -TRACE_CMD_OBJS += trace-output.o
> > >  TRACE_CMD_OBJS += trace-usage.o
> > >  TRACE_CMD_OBJS += trace-msg.o
> > >  
> >  
> 
> 


  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-11 13:03 [PATCH 0/7] Separate trace-cmd and libtracecmd code Tzvetomir Stoyanov (VMware)
2019-07-11 13:03 ` [PATCH 1/7] trace-cmd: Move trace-output.c into the library code Tzvetomir Stoyanov (VMware)
2019-08-08 23:37   ` Steven Rostedt
2019-08-09 13:22     ` Tzvetomir Stoyanov
2019-08-09 13:59       ` Steven Rostedt [this message]
2019-08-09 15:02         ` Steven Rostedt
2019-07-11 13:03 ` [PATCH 2/7] trace-cmd: Move trace-msg.c into the library Tzvetomir Stoyanov (VMware)
2019-07-11 13:03 ` [PATCH 3/7] trace-cmd: Move trace-cmd global variable "quiet" to libtracecmd Tzvetomir Stoyanov (VMware)
2019-07-11 13:03 ` [PATCH 4/7] trace-cmd: Move trace-cmd global variable "debug" " Tzvetomir Stoyanov (VMware)
2019-07-11 13:03 ` [PATCH 5/7] trace-cmd: Move plog() function " Tzvetomir Stoyanov (VMware)
2019-07-11 13:03 ` [PATCH 6/7] trace-cmd: Move trace-cmd APIs from trace-cmd.h to trace-local.h Tzvetomir Stoyanov (VMware)
2019-07-11 13:03 ` [PATCH 7/7] trace-cmd: Move tracecmd_stack_tracer_status() function to libtracecmd Tzvetomir Stoyanov (VMware)

Reply instructions:

You may reply publically 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=20190809095907.429e47b5@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=tstoyanov@vmware.com \
    --cc=tz.stoyanov@gmail.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

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org linux-trace-devel@archiver.kernel.org
	public-inbox-index linux-trace-devel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox