All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>,
	rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v3 4/5] kernel-shark-2.alpha: Force trace-cmd.h to be used as plain C
Date: Wed, 22 Apr 2020 16:40:57 +0300	[thread overview]
Message-ID: <f2787def-0351-bcec-1e3a-644d1e022c21@gmail.com> (raw)
In-Reply-To: <20200416160047.77118-5-tz.stoyanov@gmail.com>



On 16.04.20 г. 19:00 ч., Tzvetomir Stoyanov (VMware) wrote:
> From: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>
> 
> C++ compiler uses name mangling to handle function overloading. As there is no function overloading in C, function names are not mangled. This breaks the linking of C library into C++ binary.
> Declare functions from trace-cmd.h as pure C, so the loader will not mangle the names when resolving them.
> 
> Signed-off-by: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>
> ---
>   src/plugins/KVMCombo.cpp | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/src/plugins/KVMCombo.cpp b/src/plugins/KVMCombo.cpp
> index 3ff9ca5..1ae03aa 100644
> --- a/src/plugins/KVMCombo.cpp
> +++ b/src/plugins/KVMCombo.cpp
> @@ -13,7 +13,9 @@
>   #include<iostream>
>   
>   // trace-cmd
> +extern "C" {
>   #include "trace-cmd/trace-cmd.h"
> +}
>   

I think we do not need to include trace-cmd.h at all.
Thanks,
Yordan


>   // KernelShark
>   #include "libkshark.h"
> 

  reply	other threads:[~2020-04-22 13:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 16:00 [PATCH v3 0/5] Various enhancements, related to reading trace.dat file Tzvetomir Stoyanov (VMware)
2020-04-16 16:00 ` [PATCH v3 1/5] kernel-shark-2.alpha: Adjust the width of marker buttons Tzvetomir Stoyanov (VMware)
2020-04-16 16:00 ` [PATCH v3 2/5] kernel-shark-2.alpha: Use new tracecmd APIs to open guest tracing file Tzvetomir Stoyanov (VMware)
2020-04-22 13:39   ` Yordan Karadzhov (VMware)
2020-04-16 16:00 ` [PATCH v3 3/5] kernel-shark-2.alpha: Print the plugin's file name in case of loading error Tzvetomir Stoyanov (VMware)
2020-04-16 16:00 ` [PATCH v3 4/5] kernel-shark-2.alpha: Force trace-cmd.h to be used as plain C Tzvetomir Stoyanov (VMware)
2020-04-22 13:40   ` Yordan Karadzhov (VMware) [this message]
2020-04-16 16:00 ` [PATCH v3 5/5] kernel-shark-2.alpha: Restructure KVMCombo plugin to use CPU mapping information from the trace files Tzvetomir Stoyanov (VMware)
2020-04-22 14:42   ` Yordan Karadzhov (VMware)

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=f2787def-0351-bcec-1e3a-644d1e022c21@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.