|
@@ -588,32 +588,23 @@ static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
|
|
int ntevs, const char *module)
|
|
int ntevs, const char *module)
|
|
{
|
|
{
|
|
int i, ret = 0;
|
|
int i, ret = 0;
|
|
- char *tmp;
|
|
|
|
|
|
+ char *mod_name = NULL;
|
|
|
|
|
|
if (!module)
|
|
if (!module)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
- tmp = strrchr(module, '/');
|
|
|
|
- if (tmp) {
|
|
|
|
- /* This is a module path -- get the module name */
|
|
|
|
- module = strdup(tmp + 1);
|
|
|
|
- if (!module)
|
|
|
|
- return -ENOMEM;
|
|
|
|
- tmp = strchr(module, '.');
|
|
|
|
- if (tmp)
|
|
|
|
- *tmp = '\0';
|
|
|
|
- tmp = (char *)module; /* For free() */
|
|
|
|
- }
|
|
|
|
|
|
+ mod_name = find_module_name(module);
|
|
|
|
|
|
for (i = 0; i < ntevs; i++) {
|
|
for (i = 0; i < ntevs; i++) {
|
|
- tevs[i].point.module = strdup(module);
|
|
|
|
|
|
+ tevs[i].point.module =
|
|
|
|
+ strdup(mod_name ? mod_name : module);
|
|
if (!tevs[i].point.module) {
|
|
if (!tevs[i].point.module) {
|
|
ret = -ENOMEM;
|
|
ret = -ENOMEM;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- free(tmp);
|
|
|
|
|
|
+ free(mod_name);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|