怎么查看命令结果linux btrace

怎么查看命令结果linux btrace,第1张

在 $ 状态下,可以运行 script 命令,然后无论是你输入的 ls -al 命令也好,还是你输入的各种 Linux 命令及其输出结果也好,都可以保存到一个文件中。例如输入:script myresult ,等你需要的结果执行完后,再输入 exit (还是 quit,我记不太清楚了,你自己可以试一下),你刚才所有的输出结果就都保存在 myresult 文件中了。

以下来自linux内核2.6.35.7版本的代码,在头文件linux/sched.h中定义

struct task_struct {

volatile long state /* -1 unrunnable, 0 runnable, >0 stopped */

void *stack

atomic_t usage

unsigned int flags /* per process flags, defined below */

unsigned int ptrace

int lock_depth /* BKL lock depth */

#ifdef CONFIG_SMP

#ifdef __ARCH_WANT_UNLOCKED_CTXSW

int oncpu

#endif

#endif

int prio, static_prio, normal_prio

unsigned int rt_priority

const struct sched_class *sched_class

struct sched_entity se

struct sched_rt_entity rt

#ifdef CONFIG_PREEMPT_NOTIFIERS

/* list of struct preempt_notifier: */

struct hlist_head preempt_notifiers

#endif

/*

* fpu_counter contains the number of consecutive context switches

* that the FPU is used. If this is over a threshold, the lazy fpu

* saving becomes unlazy to save the trap. This is an unsigned char

* so that after 256 times the counter wraps and the behavior turns

* lazy againthis to deal with bursty apps that only use FPU for

* a short time

*/

unsigned char fpu_counter

#ifdef CONFIG_BLK_DEV_IO_TRACE

unsigned int btrace_seq

#endif

unsigned int policy

cpumask_t cpus_allowed

#ifdef CONFIG_TREE_PREEMPT_RCU

int rcu_read_lock_nesting

char rcu_read_unlock_special

struct rcu_node *rcu_blocked_node

struct list_head rcu_node_entry

#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */

#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)

struct sched_info sched_info

#endif

struct list_head tasks

struct plist_node pushable_tasks

struct mm_struct *mm, *active_mm

#if defined(SPLIT_RSS_COUNTING)

struct task_rss_stat rss_stat

#endif

/* task state */

int exit_state

int exit_code, exit_signal

int pdeath_signal /* The signal sent when the parent dies */

/* ??? */

unsigned int personality

unsigned did_exec:1

unsigned in_execve:1 /* Tell the LSMs that the process is doing an

* execve */

unsigned in_iowait:1

/* Revert to default priority/policy when forking */

unsigned sched_reset_on_fork:1

pid_t pid

pid_t tgid

#ifdef CONFIG_CC_STACKPROTECTOR

/* Canary value for the -fstack-protector gcc feature */

unsigned long stack_canary

#endif

/*

* pointers to (original) parent process, youngest child, younger sibling,

* older sibling, respectively. (p->father can be replaced with

* p->real_parent->pid)

*/

struct task_struct *real_parent/* real parent process */

struct task_struct *parent/* recipient of SIGCHLD, wait4() reports */

/*

* children/sibling forms the list of my natural children

*/

struct list_head children /* list of my children */

struct list_head sibling /* linkage in my parent's children list */

struct task_struct *group_leader /* threadgroup leader */

/*

* ptraced is the list of tasks this task is using ptrace on.

* This includes both natural children and PTRACE_ATTACH targets.

* p->ptrace_entry is p's link on the p->parent->ptraced list.

*/

struct list_head ptraced

struct list_head ptrace_entry

/* PID/PID hash table linkage. */

struct pid_link pids[PIDTYPE_MAX]

struct list_head thread_group

struct completion *vfork_done /* for vfork() */

int __user *set_child_tid /* CLONE_CHILD_SETTID */

int __user *clear_child_tid /* CLONE_CHILD_CLEARTID */

cputime_t utime, stime, utimescaled, stimescaled

cputime_t gtime

#ifndef CONFIG_VIRT_CPU_ACCOUNTING

cputime_t prev_utime, prev_stime

#endif

unsigned long nvcsw, nivcsw/* context switch counts */

struct timespec start_time /* monotonic time */

struct timespec real_start_time /* boot based time */

/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */

unsigned long min_flt, maj_flt

struct task_cputime cputime_expires

struct list_head cpu_timers[3]

/* process credentials */

const struct cred *real_cred /* objective and real subjective task

* credentials (COW) */

const struct cred *cred /* effective (overridable) subjective task

* credentials (COW) */

struct mutex cred_guard_mutex /* guard against foreign influences on

* credential calculations

* (notably. ptrace) */

struct cred *replacement_session_keyring/* for KEYCTL_SESSION_TO_PARENT */

char comm[TASK_COMM_LEN]/* executable name excluding path

- access with [gs]et_task_comm (which lock

it with task_lock())

- initialized normally by setup_new_exec */

/* file system info */

int link_count, total_link_count

#ifdef CONFIG_SYSVIPC

/* ipc stuff */

struct sysv_sem sysvsem

#endif

#ifdef CONFIG_DETECT_HUNG_TASK

/* hung task detection */

unsigned long last_switch_count

#endif

/* CPU-specific state of this task */

struct thread_struct thread

/* filesystem information */

struct fs_struct *fs

/* open file information */

struct files_struct *files

/* namespaces */

struct nsproxy *nsproxy

/* signal handlers */

struct signal_struct *signal

struct sighand_struct *sighand

sigset_t blocked, real_blocked

sigset_t saved_sigmask /* restored if set_restore_sigmask() was used */

struct sigpending pending

unsigned long sas_ss_sp

size_t sas_ss_size

int (*notifier)(void *priv)

void *notifier_data

sigset_t *notifier_mask

struct audit_context *audit_context

#ifdef CONFIG_AUDITSYSCALL

uid_t loginuid

unsigned int sessionid

#endif

seccomp_t seccomp

/* Thread group tracking */

u32 parent_exec_id

u32 self_exec_id

/* Protection of (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed,

* mempolicy */

spinlock_t alloc_lock

#ifdef CONFIG_GENERIC_HARDIRQS

/* IRQ handler threads */

struct irqaction *irqaction

#endif

/* Protection of the PI data structures: */

raw_spinlock_t pi_lock

#ifdef CONFIG_RT_MUTEXES

/* PI waiters blocked on a rt_mutex held by this task */

struct plist_head pi_waiters

/* Deadlock detection and priority inheritance handling */

struct rt_mutex_waiter *pi_blocked_on

#endif

#ifdef CONFIG_DEBUG_MUTEXES

/* mutex deadlock detection */

struct mutex_waiter *blocked_on

#endif

#ifdef CONFIG_TRACE_IRQFLAGS

unsigned int irq_events

unsigned long hardirq_enable_ip

unsigned long hardirq_disable_ip

unsigned int hardirq_enable_event

unsigned int hardirq_disable_event

int hardirqs_enabled

int hardirq_context

unsigned long softirq_disable_ip

unsigned long softirq_enable_ip

unsigned int softirq_disable_event

unsigned int softirq_enable_event

int softirqs_enabled

int softirq_context

#endif

#ifdef CONFIG_LOCKDEP

# define MAX_LOCK_DEPTH 48UL

u64 curr_chain_key

int lockdep_depth

unsigned int lockdep_recursion

struct held_lock held_locks[MAX_LOCK_DEPTH]

gfp_t lockdep_reclaim_gfp

#endif

/* journalling filesystem info */

void *journal_info

/* stacked block device info */

struct bio_list *bio_list

/* VM state */

struct reclaim_state *reclaim_state

struct backing_dev_info *backing_dev_info

struct io_context *io_context

unsigned long ptrace_message

siginfo_t *last_siginfo/* For ptrace use. */

struct task_io_accounting ioac

#if defined(CONFIG_TASK_XACCT)

u64 acct_rss_mem1 /* accumulated rss usage */

u64 acct_vm_mem1 /* accumulated virtual memory usage */

cputime_t acct_timexpd /* stime + utime since last update */

#endif

#ifdef CONFIG_CPUSETS

nodemask_t mems_allowed /* Protected by alloc_lock */

int mems_allowed_change_disable

int cpuset_mem_spread_rotor

int cpuset_slab_spread_rotor

#endif

#ifdef CONFIG_CGROUPS

/* Control Group info protected by css_set_lock */

struct css_set *cgroups

/* cg_list protected by css_set_lock and tsk->alloc_lock */

struct list_head cg_list

#endif

#ifdef CONFIG_FUTEX

struct robust_list_head __user *robust_list

#ifdef CONFIG_COMPAT

struct compat_robust_list_head __user *compat_robust_list

#endif

struct list_head pi_state_list

struct futex_pi_state *pi_state_cache

#endif

#ifdef CONFIG_PERF_EVENTS

struct perf_event_context *perf_event_ctxp

struct mutex perf_event_mutex

struct list_head perf_event_list

#endif

#ifdef CONFIG_NUMA

struct mempolicy *mempolicy /* Protected by alloc_lock */

short il_next

#endif

atomic_t fs_excl /* holding fs exclusive resources */

struct rcu_head rcu

/*

* cache last used pipe for splice

*/

struct pipe_inode_info *splice_pipe

#ifdef CONFIG_TASK_DELAY_ACCT

struct task_delay_info *delays

#endif

#ifdef CONFIG_FAULT_INJECTION

int make_it_fail

#endif

struct prop_local_single dirties

#ifdef CONFIG_LATENCYTOP

int latency_record_count

struct latency_record latency_record[LT_SAVECOUNT]

#endif

/*

* time slack valuesthese are used to round up poll() and

* select() etc timeout values. These are in nanoseconds.

*/

unsigned long timer_slack_ns

unsigned long default_timer_slack_ns

struct list_head *scm_work_list

#ifdef CONFIG_FUNCTION_GRAPH_TRACER

/* Index of current stored address in ret_stack */

int curr_ret_stack

/* Stack of return addresses for return function tracing */

struct ftrace_ret_stack *ret_stack

/* time stamp for last schedule */

unsigned long long ftrace_timestamp

/*

* Number of functions that haven't been traced

* because of depth overrun.

*/

atomic_t trace_overrun

/* Pause for the tracing */

atomic_t tracing_graph_pause

#endif

#ifdef CONFIG_TRACING

/* state flags for use by tracers */

unsigned long trace

/* bitmask of trace recursion */

unsigned long trace_recursion

#endif /* CONFIG_TRACING */

#ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */

struct memcg_batch_info {

int do_batch /* incremented when batch uncharge started */

struct mem_cgroup *memcg/* target memcg of uncharge */

unsigned long bytes /* uncharged usage */

unsigned long memsw_bytes/* uncharged mem+swap usage */

} memcg_batch

#endif

}

【IT168 评测】在我们挑选一款笔记本电脑的时候,显卡由于在应用上左右了大部分的性能发挥,所以成为性能判定的重要一环,好的显卡能在大型3D游戏的表现上更加完美,成为众多游戏爱好者的首选。而在商务专业领域,部分中高端的机型则配备了与消费级完全不同的专业显卡,特别以移动工作站的配置更为抢眼,它们价格虽高,却在数字内容创作、计算机辅助设计、金融计算、医疗仿真、油气勘探等专业领域均得到了广泛的应用。

不过随着笔记本显卡性价比的提高,不少价格位于中段的笔记本显卡的配置也是越来越强,例如目前中段性能较好的HD 5650的显卡价格仅为5000元左右,而之前一些配置专业显卡的商务笔记本价格也走低,配备了NVIDIA Quadro NVS 3100M专业显卡的ThinkPad T410i的价格最便宜仅售7000多元。这两方面的趋势让不少想挑选一款以设计为目的的用户产生了一定的疑惑,到底该怎么判定中断游戏本和专业显卡笔记本的区别呢,到底谁更专业谁更全能?而另一方面,移动工作站的高分屏、屏幕色彩佳、性能出色让不少的游戏爱好者青睐,而将它作为游戏笔记本来使用,那么这样到底适合不适合呢?接下来,我们将来探寻一下新平台下的游戏本和移动工作站,谁能全面到位。

测试机型平台介绍

索尼EA2S是索尼在2010年最新推出的E2系列中颇受关注的产品,该机采用了酷睿i5 520M、4GB DDR3内存、500GB硬盘以及HD 5650独立显卡的配置,而HD 5650则是ATi竞争主流娱乐笔记本

市场的一款利器,目前采用这款中端独立

显卡

的产品主要有

联想

的Y460A、Acer的4745G以及

索尼

的E2等多款产品,其性能目前已经得到了市场的充分肯定,该机将作为游戏本的代表。

HD 5650独立显卡

GPUZ截图

而提到移动工作站,无非就是ThinkPad、HP、DELL几家的产品。特别是对于ThinkPad来说,继W700、W700ds和W500之后,ThinkPad W系列又推出了W500的升级型号W510,肩负图形工作站的使命,W510理所当然的将处理器升级到了英特尔新一代高新更移动级处理器酷睿i7,并配置了NVIDIA Quadro FX 880M 1GB专业显卡和4GB DDR3 1066内存。

Quadro FX880M显卡信息

而W510配备的Quadro FX880M显卡,在移动版Quadro中属于中端产品,FX880M一共有48个流处理器,1GB显存容量,显卡的显存位宽为128-bit,带宽为25.6GB/s。

Futuremark 3DMark Vantage v1.01

Preset=Entry Resolution=1024x768

测试分数总分

显卡得分处理器得分

索尼EA2S

E10404

11831

7639

W510 43193PC

E12052

11831

12766

这两个产品并不属于一个数量级上的产品,但是我们通过3DMarks Vantage的得分发现这两款机型的显卡测试的分数虽然有些差距,但是主要是由于处理器的分数影响的,而在显卡得分上完全一样,在很多人眼中3DMarks的测试分数有很大的参考价值,那么移动工作站和游戏本真的能够互通吗?谁更两全呢?

游戏显卡和专业显卡有着本质的区别

虽然两款显卡在3DMarks上的分数类似,但是专业图形卡与游戏卡在图形处理器硬件设计中采用不同的理念。从驱动上就能看出很多的差别。对于游戏卡来说,在驱动程序中只需要对游戏中常用到的部分OpenGL函数能够提供很好支持就可以了,而专业图形卡由于面向范围广泛的专业应用软件,因此它必须要能够对所有OpenGL函数都予以支持。正是这些原因,在游戏中性能很好的游戏卡在运行专业软件时经常会出现性能剧烈下降的现象。

驱动中增加了许多专业软件设置

都能给设计软件进行分别设置和优化

游戏卡在驱动程序中只需要对游戏中常用到的部分OpenGL函数能够提供很好支持就OK了,而专业显卡由于面向广域的专业图形应用软件,所以它必须要能够对所有OpenGL函数都予以支持。而专业卡的驱动程序完全针对OpenGL的所有函数进行优化,同时,针对各个不同的应用程序的特别之处采用专门的解决办法,如在驱动程序里面提供各种主要软件的优化设置选项,提供专门的驱动程序。反过来说,游戏卡会针对某些热门游戏会专门做一些优化。

3DMAX中的针对性设置

不过游戏卡目前虽然可以都可以很好地支持各种OpenGL和Direct3D游戏,但是,它们更多地专注于游戏中需要的那些功能。为节约成本而计,对于在游戏中明显不会用到的那些功能如线框模式的抗混淆(反锯齿)、双面光照、3D动态剖切(3D Windows Clipping)等功能一般是不会在硬件中予以支持的。而专业图形卡则不然,与游戏显卡总是运行在全屏幕、只用于表现完全渲染好的场景的情况不同的是,专业应用软件中往往更多的时间是在显示模型正在创建和编辑状态中的情形,因此线框模式、阴影模式下的性能也是至关重要的,各种专业软件所涉及到的功能都应该在硬件上予以支持。另外,从性能上来说,游戏运行需要足够快的速度,而且游戏的场景往往不太复杂,因此游戏的性能瓶颈大多出现在像素或者纹理处理速度上;专业应用中,像高级场景渲染、CAD/CAM、影视用三维动画等应用领域往往会遇上非常大规模的模型和许多光源,因此图形系统的几何与光线处理能力是至关重要的。这两者的区别造成游戏卡与专业卡在硬件设计上各有侧重,那么接下来,我们就全面的用这种软件软件进行分析。

专业软件测试

CineBench R10

CineBench是基于Cinem4D工业三维设计软件引擎的测试软件,用来测试对象在进行三维设计时的性能,它可以同时测试处理器子系统、内存子系统以及显示子系统,在服务器测试平台中显示子系统不重要,因此就只有前两个的成绩具有意义。和大多数工业设计软件一样,CineBench可以完善地支持多核/多处理器,它的显示子系统测试基于OpenGL。

索尼EA2S CINEBENCH R10测试成绩截图

W510 43193PC CINEBENCH R10测试成绩截图

从测试的分数来看,索尼EA2S的显卡得分为5091.而W510 43193PC为5961,两者存在一定的差距。 

POV-Ray 3.6

POV-Ray是由名为Persistence OF Vision Devlopmentteam的开发小组在DKBTrace2.12的基础上编写而成的一个场景渲染软件。它为了减少了编制算法程序的时间而使用专用的场景描述语言来绘制三维场景。POV-Ray同时支持32位和64位,提供了Windows、Linux等多个平台下的运行版本。

索尼EA2S测试截图

W510 43193PC 测试截图

我们使用的是内置的Benchmark,测试分辨率为1280*1024,开启了抗锯齿功能。最终我们看到,索尼EA2S测试成绩为187PPS,耗时为787秒;W510 43193PC测试成绩为209.65 PPS,耗时为702.74。

Specviewfer10

SPECviewperf用于测量运行在OpenGL应用程序接口之下的系统3D图形性能。目前的测试场景涵盖了3ds max, CATIA, EnSight, Maya, Pro/ENGINEER, SolidWorks, UGS NX 3和UGS Teamcenter Visualization Mockup等常见设计软件的应用。在该项测试中,我们选择在1280X1024分辨率下运行所有测试子项目,测试结果如下。

Specviewfer10

Resolution=1280X1024

测试项目索尼EA2S

W510 43193PC

3dsmax-04

18.47

45.06

catia-02

14.63

48.27

ensight-03

17.82

42.11

maya-02

31.04

198.62

proe-04

12.20

62.48

sw-01

29.42

103.26

tcvis-01

7.77

26.44

ugnx-01

8.85

25.31

从测试的结果来看,游戏移动工作站在专业软件上的优化,让这个测试的差距产生的非常的明显。在3dsmax04、cATIa02、maya02、proe04、sw01、tcvis六个项目中,游戏显卡根本没有对其进行任何优化,起不到加速作用,核心规格、显存大小、频率都不会对性能造成影响。从性能上来说,游戏运行需要足够快的速度,而且游戏的场景往往不太复杂,因此游戏的性能瓶颈大多出现在像素或者纹理处理速度上;专业应用中,像高级场景渲染,CAD/CAM,影视用三维动画等应用领域往往会遇上非常大规模的模型和许多光源,因此图形系统的几何与光线处理能力是至关重要的。

应用及游戏测试

SONY Vegas Pro 8

这是一款知名的视频编辑软件,功能丰富而且强大,我们主要利用这款软件进行视频编码输出。视频源为348MB,分辨率1280X720,片长3分15秒视频文件,视频压缩输出格式为:MPEG-4 AVI格式,Xvid Single Pass编码。记录 *** 作时间,时间越短越好。

SONY Vegas Pro 8

渲染画面

从测试的结果来看,索尼EA2S耗时5分59秒;而W510 43193PC为3分10秒,两者存在一定的差距,主要是由于处理器和内存所引起的。

3D设计软件

3D模型

专业显卡由于针对专业3D设计软件做过优化,所以在显示上更为准确,图中是在3DMax中一张建筑的模型,请注意图中箭头所指部分,由于游戏显卡无法良好的支持专业3D设计软件,所以在模型的显示上,出现了破面等错误显示。而绿色箭头所指部分才是正确的显示。而且,如果模型越复杂,构成模型所用的面越多,这种错误也就越常见。

街头霸王4

PC版《街头霸王IV》是家用机版的完全移植版,将对应Game for Windows Live功能,支持在线对战、游戏内短信交流和即时语音聊天。PC版除了支持高解析度画面输出之外,还为玩家提供了画面渲染风格选择的功能,除与家用机版一样的“普通”模式外,还有“水彩”、“海报”和“烟灰墨”这三种追加的渲染风格。玩家在游戏的设定选项中,可以根据自己的喜好对显示效果进行调解。

街头霸王4 游戏画面

在测试中我们采用了Capcom官方的PC性能测试软件来进行测试,测试软件包括三场对战回放视频以及8位角色同时登场摆POSE的测试模式,最终将显示对玩家PC硬件的评测结果。我们选择了三种分辨率来运行这个测试,分别为1024X768、1280X720和1366X768像素,其余设置使用游戏默认设置。

索尼EA2S在街头霸王4测试成绩

而由于W510采用了高分屏,我们通过1024X768、1280X1024、1600X900以及1920X1080分辨率下的fps如何。测试使用的是该游戏的测试程序,仅对分辨率进行调整,其他特效默认。该机在1280X1024分辨率下平均FPS为29.67,在最高分辨率1920X1080下的平均FPS为22.12。这说明以游戏本优化的索尼EA2S在游戏的表现上更为出色。

游戏本适合游戏 工作站适合工作

通过以上这些测试,我们基本能够得出游戏本在游戏上的表现更好,而在专业领域绝对不是移动工作站的对手,不过移动工作站如果只玩游戏还真是浪费,两者的侧重点完全不同。另外,对游戏显卡对游戏的优化与对专业软件的优化会有些冲突,产生莫名其妙的问题,因此专业显卡和游戏显卡只能是术业有专攻,针对不同应用程序的兼容和优化,游戏卡跑专业软件会很慢,而专业卡跑游戏的效果也并不理想,正所谓鱼和熊掌不可得兼!

而移动工作站除了搭配专业显卡让其表现更好之外,该机采用了绚丽的1080P多点触摸屏,并拥有95%广色域,还配备了色彩矫正器来矫正屏幕色彩,可以为用户省去额外的开支。该机强大的性能,特别是酷睿i7所带来的处理器和内存能力都比前一代产品有了明显的提升。如果你需求的是一款最高性能的移动工作站,这款ThinkPad W510将是你最好的选择之一。

W510自带的色彩矫正软件

而索尼EA2S作为一款消费级的中段产品,可以称之为目前中段游戏本的一个代表,无论是在色彩、 *** 作舒适度还是性能上都可圈可点,这款产品足以应付目前主流的应用,无论您是以日常办公、文本应用、影视娱乐还是游戏娱乐为主的用户,这款产品都能够为您提供一个比较完整的解决方案。通过测试我们也可以看出,不同显卡还是适合各自领域的发挥,交叉的应用无法发挥出该机的完美性能来。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/7124157.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-01
下一篇2023-04-01

发表评论

登录后才能评论

评论列表(0条)

    保存