systemtap: add patch to find compressed modules.
This commit is contained in:
parent
bf2ef44e31
commit
7d37696185
2 changed files with 40 additions and 1 deletions
|
@ -0,0 +1,39 @@
|
|||
From 273d6c3a7f76e2c1c3f5634a1c1274323b12745c Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Tue, 7 Oct 2014 12:38:39 -0700
|
||||
Subject: [PATCH] RHBZ1150166: Handle the filename of compressed modules
|
||||
|
||||
This allows filenames like ".ko.xz" in modname_from_path().
|
||||
---
|
||||
setupdwfl.cxx | 15 ++++++++++++---
|
||||
1 file changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
--- setupdwfl.cxx
|
||||
+++ setupdwfl.cxx
|
||||
@@ -114,11 +114,20 @@ static const string abrt_path =
|
||||
string
|
||||
modname_from_path(const string &path)
|
||||
{
|
||||
- size_t dot = path.rfind('.');
|
||||
size_t slash = path.rfind('/');
|
||||
- if (dot == string::npos || slash == string::npos || dot < slash)
|
||||
+ if (slash == string::npos)
|
||||
return "";
|
||||
- string name = path.substr(slash + 1, dot - slash - 1);
|
||||
+ string name = path.substr(slash + 1);
|
||||
+
|
||||
+ // First look for .ko extension variants like ".ko" or ".ko.xz"
|
||||
+ // If that fails, look for any ".*" extension at all.
|
||||
+ size_t extension = name.rfind(".ko");
|
||||
+ if (extension == string::npos)
|
||||
+ extension = name.rfind('.');
|
||||
+ if (extension == string::npos)
|
||||
+ return "";
|
||||
+
|
||||
+ name.erase(extension);
|
||||
replace_if(name.begin(), name.end(), is_comma_dash, '_');
|
||||
return name;
|
||||
}
|
||||
--
|
||||
1.9.3
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'systemtap'
|
||||
pkgname=systemtap
|
||||
version=2.6
|
||||
revision=1
|
||||
revision=2
|
||||
build_style=gnu-configure
|
||||
makedepends="elfutils-devel"
|
||||
short_desc="Infrastructure to simplify the gathering of information"
|
||||
|
|
Loading…
Reference in a new issue