summaryrefslogtreecommitdiffstats
path: root/base/process_util_mac.mm
Commit message (Collapse)AuthorAgeFilesLines
* Die on an OOM situation in many more cases.avi@chromium.org2010-03-191-15/+137
| | | | | | | | | | | Continuation of http://codereview.chromium.org/875004 after a revert. BUG=http://crbug.com/12673 TEST=run out of memory and die Review URL: http://codereview.chromium.org/1039007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42127 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 41834; ui tests are asploding.avi@chromium.org2010-03-171-136/+16
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41837 0039d316-1c4b-4281-b951-d872f2087c98
* Die on an OOM situation in many more cases.avi@chromium.org2010-03-171-16/+136
| | | | | | | | | BUG=http://crbug.com/12673 TEST=run out of memory and die Review URL: http://codereview.chromium.org/875004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41834 0039d316-1c4b-4281-b951-d872f2087c98
* Temporarily allow writing to the default malloc zone structure while ↵avi@chromium.org2010-02-011-0/+24
| | | | | | | | | | | modifying it. BUG=none TEST=no crash when launching Chromium next year Review URL: http://codereview.chromium.org/557084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37733 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 37721.avi@chromium.org2010-02-011-24/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37723 0039d316-1c4b-4281-b951-d872f2087c98
* Temporarily allow writing to the default malloc zone structure while ↵avi@chromium.org2010-02-011-0/+24
| | | | | | | | | | | modifying it. BUG=none TEST=no crash when launching Chromium next year Review URL: http://codereview.chromium.org/551229 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37721 0039d316-1c4b-4281-b951-d872f2087c98
* Mac: Fix %cpu in task manager.thakis@chromium.org2010-01-251-4/+3
| | | | | | | | | | | I changed %cpu from int to double but left the +0.5 for rounding in. Duh. BUG=32464 TEST=Task Manager %cpu should match Activity Monitor's %cpu. In particular, inactive processes should have 0.0% cpu instead of 0.5%. Review URL: http://codereview.chromium.org/548135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37004 0039d316-1c4b-4281-b951-d872f2087c98
* Mac: UI tweaks for task manager.thakis@chromium.org2010-01-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Nib change: Reduce row height, make scrollbars smaller. Make text in task manager table slightly smaller. Show in decimal digit for %cpu. Show memory in KB/MB, not always in K. Change update frequency from 1s to 2s to match Activity Monitor's default. (all mac-only. ui team is fine with this.) Finally, turn taskman on. BUG=13156 TEST=Open task manager, look at it. Should look & feel similar to Activity Monitor. Review URL: http://codereview.chromium.org/536038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36096 0039d316-1c4b-4281-b951-d872f2087c98
* Mac: Create a pid->task_t mapping in the browser process.thakis@chromium.org2009-12-211-4/+4
| | | | | | | | | | | Since nothing writes to this map in the browser atm, this does not have any visible effect. BUG=13156,25454 TEST=unittest Review URL: http://codereview.chromium.org/501138 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35092 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 35025 - Revert 34994, maybe it regressed startup perf Fix cpu/memory ↵viettrungluu@chromium.org2009-12-191-7/+118
| | | | | | | | | | | | | | | | | | | measurements on OS X. Right now, this only works for the current process; support for child processes will be added in a later CL. BUG=13156,25454 TEST=Hook up task manager (connect menu item to commandDispatch:, give it the right tag). Stats for the browser process should now be right, and %cpu should be 0 (for now) for all other processes. Review URL: http://codereview.chromium.org/500118 TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/504068 TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/505056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35043 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 34994, maybe it regressed startup perf - Fix cpu/memory measurements ↵thakis@chromium.org2009-12-191-118/+7
| | | | | | | | | | | | | | | | on OS X. Right now, this only works for the current process; support for child processes will be added in a later CL. BUG=13156,25454 TEST=Hook up task manager (connect menu item to commandDispatch:, give it the right tag). Stats for the browser process should now be right, and %cpu should be 0 (for now) for all other processes. Review URL: http://codereview.chromium.org/500118 TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/504068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35025 0039d316-1c4b-4281-b951-d872f2087c98
* Fix cpu/memory measurements on OS X.thakis@chromium.org2009-12-181-7/+118
| | | | | | | | | | | Right now, this only works for the current process; support for child processes will be added in a later CL. BUG=13156,25454 TEST=Hook up task manager (connect menu item to commandDispatch:, give it the right tag). Stats for the browser process should now be right, and %cpu should be 0 (for now) for all other processes. Review URL: http://codereview.chromium.org/500118 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34994 0039d316-1c4b-4281-b951-d872f2087c98
* Don't use logging from the OOM killers; it allocates memory.avi@google.com2009-11-211-9/+9
| | | | | | | | | BUG=none TEST=watch crash logs; the OOM killer functions should never be called from another OOM killer function. Review URL: http://codereview.chromium.org/411006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32717 0039d316-1c4b-4281-b951-d872f2087c98
* Log warnings, not errors, if we can't fetch memory status forsgk@google.com2009-11-131-3/+5
| | | | | | | | | commit charge reporting. Fix if-blocks around returning 0. BUG=none TEST=none Review URL: http://codereview.chromium.org/386031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31964 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure OOM is a killer on the Mac.avi@chromium.org2009-11-121-0/+90
| | | | | | | | | BUG=http://crbug.com/12673 TEST=as in bug Review URL: http://codereview.chromium.org/385054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31819 0039d316-1c4b-4281-b951-d872f2087c98
* More memory stats code cleanup:sgk@chromium.org2009-11-091-0/+22
| | | | | | | | | | | | Move GetSystemCommitCharge() into bsae\process_util*. Kill PrintChromeMemoryUsageInfo(), which was only used by reliability_tests.exe on Windows and whose stats are obsolete. Delete the now-unnecessary chrome\test\perf\mem_usage* files. BUG=none TEST=none Review URL: http://codereview.chromium.org/371025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31423 0039d316-1c4b-4281-b951-d872f2087c98
* Copy the relevant parts of ICU to a new file base/third_party/icu/icu_utf.*brettw@chromium.org2009-10-071-4/+5
| | | | | | | | | | | | | | so we can do basic UTF8/16/32 conversions without linking all of ICU. Change callers who used to call SysUTF8ToWide/SysWideToUTF8 in base to using these new functions. I will remove the Sys versions of these functions in a later patch. TEST=none BUG=none Review URL: http://codereview.chromium.org/243102 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28219 0039d316-1c4b-4281-b951-d872f2087c98
* Some scaffolding for the task manager.thakis@chromium.org2009-09-151-0/+11
| | | | | | | | | BUG=13156 TEST=Connect view->task manager to first responder's commandDispatch: and give the menu item the tag 40005. Now clicking that menu item should bring up a completely unfunctional task manager window (but it has a localized title and button). Review URL: http://codereview.chromium.org/200094 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26278 0039d316-1c4b-4281-b951-d872f2087c98
* When forking, restore the default exception handler port.mark@chromium.org2009-09-031-0/+19
| | | | | | | | | | | | | | | | | | | | | The browser process launches children with fork && exec. On the Mac, this results in a child that has its exception ports set the same as the parent. When Breakpad is enabled, this means that a child such as a renderer process begins its life with its exception port pointing to a Breakpad instance running inside the browser. This is not intended. Even if the child installs its own Breakpad handler (which a renderer would), the previous handler would be pointing to the instance inside the browser, and if the child's Breakpad is misconfigured to pass exceptions to the previous handler it will wind up being passed back to the parent. The misconfiguration was corrected in r25311. This change restores the default exception handler port, which should be Apple Crash Reporter/ReportCrash, in the child process immediately after it it has been forked. BUG=20371 TEST=None, because r25311 fixed the visible aspect of this bug Review URL: http://codereview.chromium.org/200007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25371 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the Mac-specific implementation of LaunchApp, and share the Linux ↵stuartmorgan@google.com2009-08-061-72/+0
| | | | | | | | | | | | | version. Fixes a race condition with file descriptors, and gives the Mac access to the environment-alterning version of LaunchApp BUG=11174 TEST=Launching render/plugin/utility processes should still work on the Mac Review URL: http://codereview.chromium.org/165067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22649 0039d316-1c4b-4281-b951-d872f2087c98
* Update the comments on why these really can't be done, and remove the notimpls.thomasvl@chromium.org2009-06-121-10/+11
| | | | | | Review URL: http://codereview.chromium.org/126011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18268 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 18159 since it wasn't using all the data it should be.thomasvl@chromium.org2009-06-111-42/+4
| | | | | | | | | TEST=none BUG=none TBR=mark Review URL: http://codereview.chromium.org/123016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18160 0039d316-1c4b-4281-b951-d872f2087c98
* Some basic memory api support that is needed for perf tests and i think the ↵thomasvl@chromium.org2009-06-111-4/+42
| | | | | | | | | | task window. BUG=none TEST=perf bots should have memory numbers now like linux. Review URL: http://codereview.chromium.org/118436 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18159 0039d316-1c4b-4281-b951-d872f2087c98
* Add memory stats for linux page cycler. On linux, we collecttc@google.com2009-05-111-0/+20
| | | | | | | | | the final RSS size and the total VM size. Review URL: http://codereview.chromium.org/113217 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15814 0039d316-1c4b-4281-b951-d872f2087c98
* POSIX: Add a macro for handling EINTR.agl@chromium.org2009-05-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On POSIX systems, system calls can be interrupted by signals. In this case, they'll return EINTR, indicating that the system call needs to be restarted. (The situation is a little more complicated than this with SA_RESTART, but you can read man 7 signal if you like.) The short of it is that you need to catch EINTR and restart the call for these system calls: * read, readv, write, writev, ioctl * open() when dealing with a fifo * wait* * Anything socket based (send*, recv*, connect, accept etc) * flock and lock control with fcntl * mq_ functions which can block * futex * sem_wait (and timed wait) * pause, sigsuspend, sigtimedwait, sigwaitinfo * poll, epoll_wait, select and 'p' versions of the same * msgrcv, msgsnd, semop, semtimedop * close (although, on Linux, EINTR won't happen here) * any sleep functions (careful, you need to handle this are restart with different arguments) We've been a little sloppy with this until now. This patch adds a macro for dealing with this and corrects every case of these system calls (that I found). The macro is HANDLE_EINTR in base/eintr_wrapper.h. It's safe to include on Windows and is a no-op there. On POSIX, it uses GCC magic to return the correct type based on the expression and restarts the system call if it throws EINTR. And you can use it like: HANDLE_EINTR(close(fd)); Or: ssize_t bytes_read = HANDLE_EINTR(read(fd, buffer, len)); *BEWARE* that it will evaluate the argument multiple times, so this is not safe: HANDLE_EINTR(close(FireMissiles())); http://groups.google.com/group/chromium-dev/browse_thread/thread/41a35b2a457d73a0 http://codereview.chromium.org/100225 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15102 0039d316-1c4b-4281-b951-d872f2087c98
* The PPID is in kp_eproc, not kp_proc. (The field we were previously looking ↵avi@google.com2009-04-231-1/+1
| | | | | | | | at was always zero.) Review URL: http://codereview.chromium.org/96009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14316 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup in chrome/browserphajdan.jr@chromium.org2009-03-251-1/+1
| | | | | | | | | | - make more things const - remove unreferenced declaration of GetGoButton - fix indentation in one place Review URL: http://codereview.chromium.org/53053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12475 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes CRLF and trailing white spaces.maruel@chromium.org2009-03-051-6/+6
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-5/+5
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite the mac named process iterator:thomasvl@chromium.org2009-02-061-67/+103
| | | | | | | | | | - walk thru only processes for this user. - properly handle walking the data collect. - handle the number of processes increasing between count and data collection. Enable the one unittest the uses the named process iterator. Review URL: http://codereview.chromium.org/20122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9305 0039d316-1c4b-4281-b951-d872f2087c98
* Implement NamedProcessIterator in base/process_util_mac.mm. Patch by Naokimark@chromium.org2009-02-051-14/+104
| | | | | | | | | Takano <takano.naoki@gmail.com> Review URL: http://codereview.chromium.org/18192 Review URL: http://codereview.chromium.org/21097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9263 0039d316-1c4b-4281-b951-d872f2087c98
* Use _NSGetEnviron instead of environ (see "man environ"). environ isn'tmark@chromium.org2009-02-031-5/+2
| | | | | | | | available in a dylib, and with this change, gyp/xcode is able to build libbase as a dylib. Review URL: http://codereview.chromium.org/21019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9089 0039d316-1c4b-4281-b951-d872f2087c98
* Add routine to close file descriptors on execjeremy@chromium.org2009-01-291-7/+1
| | | | | | | | for linux and mac. See BUG 6598. Review URL: http://codereview.chromium.org/18801 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8892 0039d316-1c4b-4281-b951-d872f2087c98
* * On POSIX, make sure we don't leak FDs when launching child Processes.jeremy@chromium.org2008-12-171-12/+52
| | | | | | | | | | | | * Add a facility to LaunchProcess() to remap a given FD into a child process. This change is needed for 2 reasons: 1)We want to use a socketpair() for IPC, the child process needs a known FD # for it's side of the socket. 2)The OS X Sandbox doesn't close FDs. Review URL: http://codereview.chromium.org/14497 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7175 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 7156.ojan@google.com2008-12-171-52/+12
| | | | | | | Broke the build. Review URL: http://codereview.chromium.org/15402 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7159 0039d316-1c4b-4281-b951-d872f2087c98
* * On POSIX, make sure we don't leak FDs when launching child Processes.jeremy@chromium.org2008-12-171-12/+52
| | | | | | | | | | | | * Add a facility to LaunchProcess() to remap a given FD into a child process. This change is needed for 2 reasons: 1)We want to use a socketpair() for IPC, the child process needs a known FD # for it's side of the socket. 2)The OS X Sandbox doesn't close FDs. Review URL: http://codereview.chromium.org/14497 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7156 0039d316-1c4b-4281-b951-d872f2087c98
* Don't require tlslite to be installed, just use what's in the treemark@chromium.org2008-12-111-1/+5
| | | | | | Review URL: http://codereview.chromium.org/13745 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6794 0039d316-1c4b-4281-b951-d872f2087c98
* * Add timeout support to POSIX WaitForSingleProcess()jeremy@chromium.org2008-12-051-7/+0
| | | | | | | | * Unify Linux & Mac implementations of WaitForSingleProcess() Review URL: http://codereview.chromium.org/12969 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6416 0039d316-1c4b-4281-b951-d872f2087c98
* Add url_request_unittest to mac build.ericroman@google.com2008-11-191-6/+21
| | | | | | Review URL: http://codereview.chromium.org/11224 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5712 0039d316-1c4b-4281-b951-d872f2087c98
* More Mac & Linux fixes for base namespaces.brettw@google.com2008-11-141-2/+2
| | | | | | Review URL: http://codereview.chromium.org/10739 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5450 0039d316-1c4b-4281-b951-d872f2087c98
* make sure we match all the tests and files that linux has running. We were ↵pinkerton@google.com2008-11-111-0/+5
| | | | | | | | never building process_posix, but now the newly added unit tests use it. Review URL: http://codereview.chromium.org/10221 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5175 0039d316-1c4b-4281-b951-d872f2087c98
* Enable stats_tabe_unittest.cc on OS X.jeremy@chromium.org2008-10-271-0/+61
Review URL: http://codereview.chromium.org/8160 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4024 0039d316-1c4b-4281-b951-d872f2087c98