From: Jens W. <jen...@de...> - 2007-07-17 16:43:59
|
This patch changes the parsing of the directories following the {dep} so that we point now to the correct ELF image for the anonymous regions. I am unsure whether this is the right way to go. Maybe we should only produce a filename as lib_image for anon regions when a generated ELF file is existing. Changes since first RFC patch: - Generated ELF file of java jit dump is in the same directory than the sample --- libpp/parse_filename.cpp | 27 ++++++++++++++++----------- libpp/profile_spec.cpp | 5 +++++ 2 files changed, 21 insertions(+), 11 deletions(-) Index: oprofile-0.9.2-jit/libpp/parse_filename.cpp =================================================================== --- oprofile-0.9.2-jit.orig/libpp/parse_filename.cpp +++ oprofile-0.9.2-jit/libpp/parse_filename.cpp @@ -116,6 +116,10 @@ vector<string> path = separate_token(filename_spec, '/'); + string vma_spec = path[path.size()-1]; + + vector<string> vma_parts = separate_token(vma_spec, '.'); + remove_base_dir(path); // pp_interface PP:3.19 to PP:3.23 path must start either with {root} @@ -153,20 +157,21 @@ // skip "{root}", "{kern}" or "{anon}" ++i; - for (; i < path.size(); ++i) { - if (path[i] == "{cg}") - break; - - if (anon) { - result.lib_image = parse_anon(path[i++]); - break; + if (anon) { + result.lib_image = + filename.substr(0, filename.size() - event_spec.size() -1) + ".jo"; + // filename.substr(0, filename.size() - event_spec.size() -1 - vma_spec.size() + vma_parts[0].size()) + ".jo"; + return result; + } else { + for (; i < path.size(); ++i) { + if (path[i] == "{cg}") + break; + result.lib_image += "/" + path[i]; } - result.lib_image += "/" + path[i]; + if (i == path.size()) + return result; } - if (i == path.size()) - return result; - // skip "{cg}" ++i; if (i == path.size() || Index: oprofile-0.9.2-jit/libpp/profile_spec.cpp =================================================================== --- oprofile-0.9.2-jit.orig/libpp/profile_spec.cpp +++ oprofile-0.9.2-jit/libpp/profile_spec.cpp @@ -357,6 +357,11 @@ if (!is_prefix(sub, "/{root}/") && !is_prefix(sub, "/{kern}/")) return false; + // strip out generated JIT object files for samples of annonymous regions + string suf = ".jo"; + if (sub.rfind(suf) == (sub.size()-suf.size())) + return false; + filename_spec file_spec(filename); if (spec.match(file_spec)) { if (exclude_dependent && file_spec.is_dependent()) -- Jens Wilke Linux on System z - Application Development Tools phone +49-(0)7031-16-3936 - tl *120-3936 - email jen...@de... IBM Germany Lab, Schoenaicher Str. 220, 71032 Boeblingen |