windows下,使用netbeans远程连接solaris11开发C++,并且使用DTrace工具

1.VM虚拟机安装sol-11-1111-text-x86.iso

 

2.安装完毕,查看gcc以及gdb版本.

gcc -v

gdb -v

sol-11-1111-text-x86 不会默认安装gnu gcc 编译器,需要自己下载安装.

 

3.安装c++ 编译器.

首先查看最新版本的gcc

root@vicky:~# pkg search gcc
INDEX           ACTION   VALUE                                                               PACKAGE
pkg.description set      GCC Runtime - Shared libraries used by gcc and other gnu components pkg:/system/library/[email protected]
pkg.summary     set      GCC Runtime libraries                                               pkg:/system/library/[email protected]
pkg.summary     set      GCC - 4.5 Compilers                                                 pkg:/developer/[email protected]
pkg.summary     set      GCC - 4.5 Runtime                                                   pkg:/system/library/[email protected]
basename        hardlink usr/sfw/bin/gcc                                                     pkg:/developer/[email protected]
basename        link     usr/bin/gcc                                                         pkg:/developer/[email protected]
pkg.description set      GCC Runtime - Shared libraries used by gcc and other gnu components pkg:/system/library/[email protected]
pkg.summary     set      gcc - The GNU C compiler                                            pkg:/developer/[email protected]
basename        dir      usr/gcc                                                             pkg:/system/library/[email protected]
basename        dir      usr/gcc/4.5/lib/gcc                                                 pkg:/system/library/[email protected]
basename        dir      usr/sfw/lib/gcc                                                     pkg:/developer/[email protected]
basename        dir      usr/sfw/libexec/gcc                                                 pkg:/developer/[email protected]
basename        dir      usr/gcc                                                             pkg:/developer/[email protected]
basename        dir      usr/gcc/4.5/lib/gcc                                                 pkg:/developer/[email protected]
basename        file     usr/gcc/4.5/bin/gcc                                                 pkg:/developer/[email protected]

 

可以通过: pkg install gcc-45 安装gcc4.5版本(但,请别这样安装!!!)

正确的安装应当是:

root@vicky:~# pkg search oracle

INDEX           ACTION VALUE                                                                                                                                                                               PACKAGE
pkg.description set    Oracle Configuration Manager (OCM) collects configuration data for upload to My Oracle Support                                                                                      pkg:/system/management/[email protected]
pkg.description set    Plugins for fbconfig configuration and Oracle VTS diagnostics software for AST graphics                                                                                             pkg:/system/graphics/fbconfig/[email protected]
pkg.description set    Plugins for fbconfig configuration and Oracle VTS diagnostics software for the Sun XVR-300, XVR-100, and XVR-50 graphics accelerators                                               pkg:/system/graphics/fbconfig/[email protected]
pkg.description set    Provides a set of GNU tools for developing C, C++, Fortran and Objective C programs on Oracle Solaris                                                                               pkg:/group/feature/[email protected]
pkg.description set    Provides a set of components for deployment of an AMP (Apache, MySQL, PHP) stack on Oracle Solaris                                                                                  pkg:/group/feature/[email protected]
pkg.description set    Provides a useful command-line Oracle Solaris environment                                                                                                                           pkg:/group/system/[email protected]
pkg.description set    Provides an Oracle Solaris Automated Installer client                                                                                                                               pkg:/group/system/[email protected]
pkg.description set    Provides an Oracle Solaris desktop environment                                                                                                                                      pkg:/group/system/[email protected]
pkg.description set    Provides an Oracle Solaris large server environment                                                                                                                                 pkg:/group/system/[email protected]
pkg.description set    Provides an Oracle Solaris multi user desktop environment for use on a server                                                                                                       pkg:/group/feature/[email protected]
pkg.description set    Provides an Oracle Solaris trusted desktop environment                                                                                                                              pkg:/group/feature/[email protected]
pkg.description set    The purpose of this project is to provide better user experience for Oracle managed contents.                                                                                       pkg:/gnome/[email protected]
pkg.description set    asr-notify is a small, lightweight daemon that subscribes to FMA problem lifecycle events and produces HTTPS/XML notifications consumed by the Oracle Auto Service Request service. pkg:/system/fault-management/[email protected]
pkg.summary     set    Oracle Solaris OpenFabrics userland libraries and applications                                                                                                                      pkg:/network/[email protected]
pkg.summary     set    Oracle Solaris Welcome Pack                                                                                                                                                         pkg:/release/[email protected]
pkg.summary     set    Oracle Solaris notices                                                                                                                                                              pkg:/release/[email protected]
pkg.summary     set    AMP (Apache, MySQL, PHP) Deployment Kit for Oracle Solaris                                                                                                                          pkg:/group/feature/[email protected]
pkg.summary     set    GNU Development Tools for Oracle Solaris                                                                                                                                            pkg:/group/feature/[email protected]
pkg.summary     set    Oracle Berkeley DB                                                                                                                                                                  pkg:/database/[email protected]
pkg.summary     set    Oracle Configuration Manager (OCM)                                                                                                                                                  pkg:/system/management/[email protected]
pkg.summary     set    Oracle Solaris Automated Installer Client                                                                                                                                           pkg:/group/system/[email protected]
pkg.summary     set    Oracle Solaris Desktop                                                                                                                                                              pkg:/group/system/[email protected]
pkg.summary     set    Oracle Solaris Large Server                                                                                                                                                         pkg:/group/system/[email protected]
pkg.summary     set    Oracle Solaris Multi User Desktop                                                                                                                                                   pkg:/group/feature/[email protected]
pkg.summary     set    Oracle Solaris Small Server                                                                                                                                                         pkg:/group/system/[email protected]
pkg.summary     set    Oracle Solaris Trusted Desktop                                                                                                                                                      pkg:/group/feature/[email protected]

 

安装:pkg install developer-gnu

大约175M左右,安装完毕后,使用gcc -v  gbd-v 查看,gcc版本!

 

4.由于我们安装的是text版本,无desktop界面,这里我依旧使用windows平台下netbeans远程开发C++方式.

windows下,使用netbeans远程连接solaris11开发C++,并且使用DTrace工具_第1张图片

右键,"添加新主机"

windows下,使用netbeans远程连接solaris11开发C++,并且使用DTrace工具_第2张图片

创建性能测试项目

windows下,使用netbeans远程连接solaris11开发C++,并且使用DTrace工具_第3张图片

右键新项目,分析中设置使用DTrace

运行项目-->查看运行监视器

windows下,使用netbeans远程连接solaris11开发C++,并且使用DTrace工具_第4张图片

 

注意,如果:内存使用情况以及I/O使用情况没有权限:

要检查您的 DTrace 权限,请在命令提示符下键入以下命令:
/bin/ppriv $$
如果您的帐户具有所需的权限,ppriv 命令应返回如下内容:
E: basic,dtrace_kernel,dtrace_proc,dtrace_user
I: basic,dtrace_kernel,dtrace_proc,dtrace_user
P: basic,dtrace_kernel,dtrace_proc,dtrace_user
L: all
以 “I:” 开头的行很重要,因为它指定了从 shell 中启动的程序所继承的权限。如果您的帐户没有所需的可继承权限,并且您没有系统的管理员权限或 root 访问权限,应请求系统管理员为您的帐户添加 dtrace_user、dtrace_proc 和 dtrace_kernel 可继承权限。
如果您具有系统的管理员权限或 root 访问权限,则可以为您的用户帐户授予所需的权限,如下所述。
要为用户帐户永久授予所需的 DTrace 权限,请执行以下操作:
1. 确保已从系统中注销要修改权限的用户帐户。
2. 以超级用户 (root) 或其他管理员用户的身份登录。
3. 在命令提示符下键入以下命令,并将 username 替换为要修改的用户帐户名:
$ usermod -K defaultpriv=basic,dtrace_kernel,dtrace_user,dtrace_proc username

 

OK.windows下,使用netbeans远程连接solaris11开发C++,并且使用DTrace工具完成!!!

 

更多内容,参见:http://www.oracle.com/technetwork/cn/systems/dtrace/dtrace/index-jsp-137532-zhs.html

你可能感兴趣的:(windows下,使用netbeans远程连接solaris11开发C++,并且使用DTrace工具)