This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: vfs tapset compilation error.
On Tue, 2011-01-25 at 23:58 +0200, Daniel Fishman wrote:
> On Tue, 25 Jan 2011 13:04:29 +0100, Mark Wielaard <mjw@redhat.com> wrote:
>
> >Just in case, could you try this hack to make sure the file names the
> >parse sees are always canonical?
>
> The problem occurs even if there is no double slashes. The additional
> slash is due to the fact that XDG_DATA_DIRS was set to /usr/share/
> (see my other reply), but the problem occurs when XDG_DATA_DIRS is
> set to /usr/share and there are no double slashes.
Aha, thanks. That makes sense. I am testing the following patch, which
should make sure all paths added to the include path are unique.
If you could also try it, that would be help.
Thanks,
Mark
>From 933705ea50ec6576f5b1ea5919a1482287b875b3 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Tue, 25 Jan 2011 23:40:22 +0100
Subject: [PATCH] Make sure all elements of the include path are unique.
---
session.cxx | 29 +++++++++++++++++++++++------
1 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/session.cxx b/session.cxx
index a79b771..6471338 100644
--- a/session.cxx
+++ b/session.cxx
@@ -20,6 +20,7 @@
#include "util.h"
#include "git_version.h"
+#include <algorithm>
#include <cerrno>
#include <cstdlib>
@@ -143,18 +144,32 @@ systemtap_session::systemtap_session ():
tokenize(s_p1, dirs, ":");
for(vector<string>::iterator i = dirs.begin(); i != dirs.end(); ++i)
{
- include_path.push_back(*i + "/systemtap/tapset");
+ string path = canonicalize_file_name ((*i + "/systemtap/tapset").c_str ());
+ if (find (include_path.begin (), include_path.end (), path)
+ == include_path.end ())
+ {
+ if (include_arg_start == -1)
+ include_arg_start = include_path.size ();
+ include_path.push_back(path);
+ }
}
}
const char* s_p = getenv ("SYSTEMTAP_TAPSET");
if (s_p != NULL)
{
- include_path.push_back (s_p);
+ string path = canonicalize_file_name (s_p);
+ if (find (include_path.begin (), include_path.end (), path)
+ == include_path.end ())
+ include_path.push_back (path);
}
else
{
- include_path.push_back (string(PKGDATADIR) + "/tapset");
+ string path = canonicalize_file_name ((string(PKGDATADIR)
+ + "/tapset").c_str ());
+ if (find (include_path.begin (), include_path.end (), path)
+ == include_path.end ())
+ include_path.push_back (path);
}
const char* s_r = getenv ("SYSTEMTAP_RUNTIME");
@@ -465,6 +480,7 @@ systemtap_session::parse_cmdline (int argc, char * const argv [])
if (grc < 0)
break;
bool push_server_opt = false;
+ string path;
switch (grc)
{
case 'V':
@@ -520,9 +536,10 @@ systemtap_session::parse_cmdline (int argc, char * const argv [])
case 'I':
if (client_options)
client_options_disallowed += client_options_disallowed.empty () ? "-I" : ", -I";
- if (include_arg_start == -1)
- include_arg_start = include_path.size ();
- include_path.push_back (string (optarg));
+ path = canonicalize_file_name (optarg);
+ if (find (include_path.begin (), include_path.end (), path)
+ == include_path.end ())
+ include_path.push_back(path);
break;
case 'd':
--
1.7.3.5