summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/profil.c
Commit message (Collapse)AuthorAgeFilesLines
* Switching the Cygwin DLL to LGPLv3+, dropping commercial buyout optioncygwin-2_5_2-releaseCorinna Vinschen2016-06-231-2/+0
| | | | | | | | | | | | | | Bump GPLv2+ to GPLv3+ for some files, clarify BSD 2-clause. Everything else stays under GPLv3+. New Linking Exception exempts resulting executables from LGPLv3 section 4. Add CONTRIBUTORS file to keep track of licensing. Remove 'Copyright Red Hat Inc' comments. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Throughout Cygwin, use u_intN_t or uintN_tCorinna Vinschen2016-03-241-4/+4
| | | | | | | | | | Don't use u_char, u_short, u_int or u_long in Cygwin, unless it refers to the Winsock types. Use u_intN_t in BSD-based sources, unsigned char where strings are concerned, uintN_t otherwise. Also: * net.cc: Fix comment, we're not using u_long anymore. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Support profiling of multi-threaded apps.Mark Geisert2016-03-101-19/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch set modifies Cygwin's profiling support to sample PC values of all an app's threads, not just the main thread. There is no change to how profiling is requested: just compile and link the app with "-pg" as usual. The profiling info is dumped into file gmon.out as always. A new facility enabled via the environment variable GMON_OUT_PREFIX. This facility is intended to match an undocumented Linux glibc feature. Exporting the variable with a non-empty value such as "foo" causes the profiling info to go to a file named foo.$pid instead of the default. With that, both resulting processes of a fork() can have their profiling data captured in separate files. gprof already knows how to accumulate data from multiple files if they all pertain to the same app. There is no change to the normal Cygwin execution paths if profiling is not enabled. And when it is enabled, only the one profiling thread per profiled app is doing more work than it used to. * include/sys/cygwin.h: Add CW_CYGHEAP_PROFTHR_ALL. * cygheap.cc (cygheap_profthr_all): New C-callable function that runs cygheap's threadlist handing each pthread's thread handle in turn to profthr_byhandle(). * external.cc (cygwin_internal): Add case CW_CYGHEAP_PROFTHR_ALL. * gmon.c (_mcleanup): Add support for multiple simultaneous gmon.out* files named via environment variable GMON_OUT_PREFIX. * gmon.h (struct gmonparam): Make state decl volatile. * mcount.c (_MCOUNT_DECL): Change stores into gmonparam.state to use Interlocked operations. Add #include "winsup.h", update commentary. * profil.c (profthr_byhandle): New function abstracting out the updating of profile counters based on a thread handle. (profthr_func): Update to call profthr_byhandle() to sample the main thread then call cygheap_profthr_all() indirectly through cygwin_internal(CW_CYGHEAP_PROFTHR_ALL) to sample all other threads. (profile_off): Zero targthr to indicate profiling was turned off. (profile_on): Fix handle leak on failure path. (profile_child): New callback func to restart profiling in child process after a fork if the parent was being profiled. (profile_ctl): Call pthread_atfork() to set profile_child callback. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* * Makefile.in (VPATH): Drop CONFIG_DIR.Corinna Vinschen2013-06-181-25/+57
| | | | | | | | | | | | | | | | | | (EXTRA_DLL_OFILES): Remove. (DLL_OFILES): Remove EXTRA_DLL_OFILES. (ASFLAGS): Define as -D_WIN64 on x86_64. (GMON_OFILES): Add mcountFunc.o. ($(srcdir)/$(TLSOFFSETS_H)): Use target_cpu rather than CONFIG_DIR. * configure.ac (CONFIG_DIR): Remove definition. * configure: Regenerate. * gcrt0.c: Use latest version from Mingw-w64 project. * gmon.c: Ditto. * gmon.h: Ditto. * mcount.c: Ditto. * mcountFunc.S: Ditto, new file. * profil.c: Ditto. * profil.h: Ditto. * config: Remove entire directory.
* * Merge in cygwin-64bit-branch.Corinna Vinschen2013-04-231-12/+16
|
* Throughout, update copyrights to reflect dates which correspond to main-branchChristopher Faylor2013-01-211-1/+1
| | | | checkins. Regularize copyright format.
* * winlean.h: New file.Christopher Faylor2010-08-301-1/+1
| | | | | | | | | | | | | | | | * automode.c: Use "winlean.h". * binmode.c: Ditto. * gmon.c: Ditto. * textmode.c: Ditto. * textreadmode.c: Ditto. * winsup.h: Ditto. * lib/cygwin_attach_dll.c: Ditto. * lib/dll_main.cc: Ditto. * profile.c: Ditto. * crt0.c: Ditto. Cleanup ancient cruft. Add dummy calls to cygwin_premain*. * include/sys/cygwin.h: Remove old stuff. Move premain declarations nearer to other cygwin-specific function declarations. * globals.cc: Add comment.
* Remove unneeded header files from source files throughout. Update copyrightsChristopher Faylor2009-01-031-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | where appropriate. * globals.cc: New file for generic global variables. * mkglobals_h: New file to generate globals.h. * mkstatic: New Script used to build a (currently non-working) static libcygwin_s.a. * Makefile.in: Add unused rule to build a non-working libcygwin_s.a. (DLL_OFILES): Add globals.o. Make all objects rely on globals.h. (globals.h): New target. Generate globals.h. * cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE operator is allowed in _cygtls. * dcrt0.cc: Move most globals to globals.cc. * init.cc: Ditto. * environ.cc (strip_title_path): Remove now-unneeded extern. * fhandler_serial.cc (fhandler_serial::open): Ditto. * pinfo.cc: Ditto. (commune_process): Ditto. * shared.cc: Ditto. * glob.cc: Ditto. * strace.cc: Ditto. * exceptions.cc: Define CYGTLS_HANDLE before including winsup.h. * path.cc (stat_suffixes): Move here. * security.h: Add forward class path_conv declaration. * smallprint.cc (__small_vsprintf): Make a true c++ function. (__small_sprintf): Ditto. (small_printf): Ditto. (console_printf): Ditto. (__small_vswprintf): Ditto. (__small_swprintf): Ditto. * spawn.cc (spawn_guts): Remove _stdcall decoration in favor of regparm. (hExeced): Move to globals.cc * strfuncs.cc (current_codepage): Ditto. (active_codepage): Ditto. * sync.cc (lock_process::locker): Move here from dcrt0.cc. * syscalls.cc (stat_suffixes): Move to path.cc. * tty.cc (tty::create_master): Uncapitalize fatal warning for consistency. * winsup.h: Include globals.h to declare most of the grab bag list of globals which were previously defined here. * mount.h: Move USER_* defines back to shared_info.h. * speclib: Force temporary directory cleanup.
* * profil.h (PROFADDR): Prevent overflow when text segments are larger thanChristopher Faylor2003-04-281-0/+2
| | | | | | 256k. * profil.c (profthr_func): Raise thread priority for more accurate sampling. * path.cc (hash_path_name): Use ino_t as type.
* Update copyrights.Christopher Faylor2001-09-111-1/+1
|
* * cygrun.c (main): Fix compiler warning.Christopher Faylor2001-04-031-1/+1
| | | | | | | | | | | * gmon.c (_mcleanup): Ditto. * profil.c (profile_off): Ditto. * net.cc (find_winsock_errno): New function. (__set_winsock_errno): Use find_winsock_errno. (cygwin_setsockopt): Detect SO_ERROR for debugging. (cygwin_getsockopt): Ditto. Translate error when getsockopt returns SO_ERROR. * winsup.h: regparmize __set_winsock_errno. * include/sys/strace.h: Document that strace functions can't use regparm.
* Whitespace cleanup.Christopher Faylor2000-10-281-5/+5
| | | | | | * configure.in: Eliminate subdir stuff. * configure: Regenerate. * include/getopt.h (option): Make name field 'const'.
* import winsup-2000-02-17 snapshotChristopher Faylor2000-02-171-0/+173