分析评估工具? [英] Profiling evaluation tools?

查看:54
本文介绍了分析评估工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我想提前为这个偏离主题道歉。它不是既不是AC也不是C ++的问题,而是一般的剖析,虽然我的机会

最好在C / C ++社区中找到答案。


我有一个C ++程序来分析它并通过生成大的

历史文件来调用相关时间来调用依赖项。它可能与gprof的数据格式相似,可以转换。


我现在正在寻找可以评估这样一棵树的实用工具。我只看了
查看了gprof的手册页,这对我来说似乎太基础了。


我已经编写了一些Python脚本可以提取像:


- 将时间分解为每个(库,文件,

函数,...)所花费的时间,专用于代表他们花费的时间在其他

这类实体中。按顺序打印。


- 根据他们的

调用依赖项给出一个(库,文件,函数)树,但不要进入下面的那些子实体

a消耗时间的某个阈值。给出通话次数和

时间(包括在子实体中花费的时间)。


所有这些已经非常有用,但我也非常想拥有:


- 我的脚本已经合并在一起了相同的子树

级别。例如,如果f调用ga次数,并且gha

次数,则只能在
$ b的树视图中获得f-> g-> h $ b数据,h行的数字是通过这个调用链的总呼叫数来计算。但是,如果在代码的不同位置发生了对f的调用,那么这些事件将不会合并

:我不能说,查看任何调用f作为整个程序

并忘记其他调用,将所有这些子树合并为一个。


- 我有一般结构属性到每个节点(即库,文件

和函数名称),但我也希望有其他属性,如

函数调用的参数值,可能只有

适用于某些功能。我需要过滤掉这些

属性的某些值或分解为它们的值。


- 反向树视图:给定(库,文件,函数) ),它经常被调用的频率是多少?代表所有它花费了多少时间?b $ b叫父母,祖父母等等,再次打破递归在

特定时间阈值。一个特殊情况就是能够从分析数据中提取一个回溯,这对于它的b
有用。

我有很多模糊的想法如何解决这个问题。


我的脚本是用Python编写的,但是它们很乱并且很慢。一个奇特的

方法将是xslt,因为它被设计为在树数据上运行。我/ b $ b在这方面没有经验 - 这可能吗?怎么样?
表演?另一个是尝试使用数据库作为

树的存储,但我不确定所有这些操作是否都有效。


最现实的选择我会在没有进一步的建议时继续使用
建议和现有的实用程序是用C ++重写我的脚本。


所有这些都需要正确思考通过,所以我真的非常宁愿使用现有的解决方案。有没有?


欢呼,

Jens

Hello,

I want to apologise in advance for this being off topic. It''s not neither
A C nor a C++ question, but to profiling in general, though I my chances
are best to find the answer in the C/C++ community.

I have a C++ program to profile and went about it by producing large
history files of calling dependencies with associated times. It is
presumably similar to gprof''s data format and could be converted.

I''m now looking for utilities that can evaluate such a tree. I only
looked at the gprof''s manual page and that seemed too basic to me.

I already wrote some Python scripts that can extract stuff like:

- Break the time down into that spent in each (libraries, files,
functions, ...), exclusive to that spent on their behalf in other
such entities. Print it in order.

- Give a tree of (libraries, files, functions) according to their
calling dependencies, but don''t recurse into those subentities below
a certain threshhold of consumed time. Give the number of calls and
time (including the time spent in subentities).

All this is already quite useful, but I also dearly want to have:

- My script is already "merging together" subtrees on the same
level. For instance, if f calls g a number of times, and g h a
number of times, you only get f->g->h once in the tree view of the
data, the number at the line of h being the total calls to h through
this callchain. However, if a call to f occurs at a number of
different places in the code, those occurences will not be merged
together: I can''t say, view any call to f as a the "whole program"
and forget other calls, merging all these subtrees into one.

- I have a general structure of attributes to each node (ie library, file
and function names), but I also want to have additional attributes like
the value of a parameter the function was called with, which may only
apply to some functions. I need to filter out certain values of these
attributes or break down to their values.

- Reverse tree view: Given a (library, file, function), how often was
it called and how much time did it spend on the behalf of all it''s
calling parent, grandparents, etc., again breaking recursion on a
certain time threshold. A special case of this is the ability to
extract a backtrace from the profiling data, which is useful on it''s
own.

I have a number of vague ideas how to go about this.

My scripts are in Python, but they are messy and slow. An exotic
approach would be xslt, since it''s designed to operate on tree-data. I
have zero experience in this regard - is this possible? how does it
perform? Another one is trying to use databases as a storage for
trees, but I''m not sure if all of these operations will be efficient.

The most realistic option I would go about in the absence of further
advice and existing utilities is to rewrite my scripts in C++.

All of this needs properly thinking through, so I''d really much rather
use an exisiting solution. Is there one?

Cheers,

Jens

推荐答案

Jens Theisen写道:
Jens Theisen wrote:
你好,

我想提前为这个偏离主题道歉。它既不是AC也不是C ++问题,


如果你知道它不是C或C ++问题而且知道它是关闭的

主题在这里,不要在这里问。

但总的来说,虽然我有机会
最好在C / C ++社区找到答案。


不,你最有可能因为张贴你的内容而被抱怨

知道错误的地方。

我有一个C ++程序来分析和通过生成调用依赖关系及相关时间的大型历史文件来实现它。它大概类似于gprof的数据格式,可以转换。
Hello,

I want to apologise in advance for this being off topic. It''s not neither
A C nor a C++ question,
If you know it is not a C or C++ question and know it is therefor off
topic here, don''t ask it here.
but to profiling in general, though I my chances
are best to find the answer in the C/C++ community.
No, you are most likely to get complained at for posting in what you
know is the wrong place.
I have a C++ program to profile and went about it by producing large
history files of calling dependencies with associated times. It is
presumably similar to gprof''s data format and could be converted.




< snip>


由于您使用的是GNU工具,请尝试询问GNU邮件列表。

或者尝试询问更一般的组或特定于操作系统的
组。不要问你知道*是错误的团体。

-

Flash Gordon

生活在有趣的时代。

网站 - http://home.flash-gordon .me.uk /

comp.lang.c张贴guidlines和介绍 -
http://clc-wiki.net/wiki/Intro_to_clc


在comp.lang.c中Theisen< jt *** @ arcor.de>写道:
In comp.lang.c Jens Theisen <jt***@arcor.de> wrote:

我有一个C ++程序来分析并通过生成调用依赖关系及相关时间的大型历史文件来实现它。它大概类似于gprof的数据格式,可以转换。

I have a C++ program to profile and went about it by producing large
history files of calling dependencies with associated times. It is
presumably similar to gprof''s data format and could be converted.



[...剪断了很多请求的功能......]


< offtopic answer>


如果你碰巧在linux上工作,请看看优秀的callgrind

和kcachegrind工具。 Callgrind是一个在

虚拟机中运行代码的工具。它可以进行分析,调用跟踪,缓存分析和

。 Kcachegrind是以各种方式显示分析结果的gui。

http://kcachegrind.sourceforge.net/cgi-bin/show.cgi

-

:wq

^ X ^ Cy ^ K ^ X ^ C ^ C ^ C ^ C


[... snipped a lot of requested features ...]

<offtopic answer following>

If you happen to work on linux, take a look at the excellent callgrind
and kcachegrind tools. Callgrind is a tool that runs your code in a
virtual machine. It can do profiling, call tracing, cache profiling and
a lot more. Kcachegrind is a gui for showing the profiling results in
various ways.

http://kcachegrind.sourceforge.net/cgi-bin/show.cgi
--
:wq
^X^Cy^K^X^C^C^C^C


Flash写道:
Flash wrote:
由于您使用的是GNU工具,请尝试在GNU邮件列表中询问。
或者尝试询问更一般的组或操作系统特定的组。不要问你知道*是错误的组。
Since you are using GNU tools, try asking in GNU mailing lists.
Alternatively try asking in a more general group or an OS specific
group. Don''t ask in what you *know* is the wrong group.




特定于操作系统的组也会出错,因为它不是操作系统具体

问题。


我搜索了新闻组或邮件列表,以便对相关会谈进行剖析,但

未能找到它们。


我不知道要问什么是合适的团体,显然你也不会是b $ b。


Jens



An OS specific group would be just as wrong, since it''s not an OS specific
problem.

I searched for newsgroups or mailinglists for profiling related talks but
failed in finding them.

I don''t know what the right group is to ask, and obviously you don''t
either.

Jens


这篇关于分析评估工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆