Most Popular in Unix
-
Random Hacking: Network Unlocking a Sony Ericsson w300i mobile phone
-
Face book, whoo hoo, a second post in a week
-
Most Highly Recommended Solaris Security Tools
-
Strip a Prepended String From a Filename - Unix
-
IrfanView - Comprehensive Graphic Viewer for Windows
-
How can i use fork,sleep,wait and write in a process with father and son..??
-
Forays into C++
-
The Admin Zen: Keep it up and running.
-
USDT in C++
-
Open Computer Forensics Architecture 2.1.0pl1 (Default branch)
USDT in C++
Many people suppose that C/C++ is dead with the advent of Java. However, C/C++ applications are still continued to be developed and deployed. Several applications such as MySQL, PhP, Java, etc. are still developed and deployed in C/C++. With DTrace, the possibilities of tracing applications and gaining an overview in a "non-destructive" way, has opened the opportunities for its usage on production quality systems. From a developer perspective, you could incrementally introduce DTrace probes in the critical paths of your code. Typically, 20% of a software's lifetime lies in the developmental phase and 80% of it is in maintainence.
To ease the debugging of applications, be it on a development system or on a production machine, DTrace offers you wide possibilities. However, the problem is not that simple. When considering C/C++, the way DTrace handles them differently. This is because of the name-mangling phenomenon, that flattens the namespaces of C++ applications. Why should this be done?
UNIX is a flat world too. UNIX understands flat namespaces and was developed or is still developed with the C-language and as a result has a flat namespace. C++ offers the hierarchial namespaces, whereby its possible to organize information in a hierarchial way. UNIX does not understand this hierarchy. Thats a problem! C++ overcomes this by flattening the namespace that makes UNIX happy. This phenomenon is called the name-decoration or name-mangling or namespace mangling and so on.
Let me illustrate this with a small program, written in C and compiled with the Sun Studio compiler ( C & C++ compilers). Lets us call this program hallo.c which has nothing spectacular, but has a simple function, void printHallo(int), taking an integer argument. This function prints the word, "Hallo", n-times depending upon the argument you pass to this function. The program listing is as follows:
meson:/export/home/mithun/USDT >more hallo.c
#include
void printHallo(int);
More Stories in Unixville
- USDT in C++
- Solaris Optimal Resource Utilization Code Camp
- DTrace and Stack Size limitation
- Random Hacking: Network Unlocking a Sony Ericsson w300i mobile phone
- NetBeans 6 Beta1 Splash Screen
- KernelTrap: Killing Tasks On Frozen NFS Mounts
- Solaris 11 b70 on a MacBook Pro with Parallels
- Dave@NetApp: Oracle Optimizes Its Database for NFS
- Audio and slides from OpenSolaris Scheduling & Processor Mgmt talk
- UltraSparc T2: Datacenter on a chip
Most Popular Stories
New Lawsuit Adds Hairline Cracks to List of iPhone Problems
Another variant of RSPlug trojan for Mac pops up
Darik's Boot and Nuke is the Nuclear Option of Secure Data Shredding
Apple flirting with another record quarter for Mac sales
The G1's Deepest, Darkest Secret: Hidden Multitouch
Why now, Omnioutliner?
Apple waiting on quad-core desktop chips from Intel
Husband Blames iPhone For Smutty Pic Debacle, Fate of Marriage Hangs on Apple Support Discussion
Ask TUAW: Apple TV, Blu-ray on the Mac, solving SIMBL problems, and more