summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows/Process.inc
Commit message (Collapse)AuthorAgeFilesLines
* sys::process::get_id() now returns the process ID instead of a process ↵Aaron Ballman2013-06-081-1/+1
| | | | | | handle on Windows. Patch thanks to Kim Gräsman! llvm-svn: 183621
* Fix an obvious typo spotted by Reid Kleckner, and breaking windows builds.Chandler Carruth2013-01-041-1/+1
| | | | llvm-svn: 171559
* Add time getters to the process interface for requesting the elapsedChandler Carruth2013-01-041-13/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wall time, user time, and system time since a process started. For walltime, we currently use TimeValue's interface and a global initializer to compute a close approximation of total process runtime. For user time, this adds support for an somewhat more precise timing mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock selected. For system time, we have to do a full getrusage call to extract the system time from the OS. This is expensive but unavoidable. In passing, clean up the implementation of the old APIs and fix some latent bugs in the Windows code. This might have manifested on Windows ARM systems or other systems with strange 64-bit integer behavior. The old API for this both user time and system time simultaneously from a single getrusage call. While this results in fewer system calls, it also results in a lower precision user time and if only user time is desired, it introduces a higher overhead. It may be worthwhile to switch some of the pass timers to not track system time and directly track user and wall time. The old API also tracked walltime in a confusing way -- it just set it to the current walltime rather than providing any measure of wall time since the process started the way buth user and system time are tracked. The new API is more consistent here. The plan is to eventually implement these methods for a *child* process by using the wait3(2) system call to populate an rusage struct representing the whole subprocess execution. That way, after waiting on a child process its stats will become accurate and cheap to query. llvm-svn: 171551
* Flesh out a page size accessor in the new API.Chandler Carruth2012-12-311-8/+6
| | | | | | | | Implement the old API in terms of the new one. This simplifies the implementation on Windows which can now re-use the self_process's once initialization. llvm-svn: 171330
* Remove an unused function in the old Process interface.Chandler Carruth2012-12-311-8/+0
| | | | llvm-svn: 171327
* Switch this code to a more idiomatic double using namespace directive.Chandler Carruth2012-12-311-3/+1
| | | | | | | | Fix a truly odd namespace qualifier that was flat out wrong in the process. The fully qualified namespace would have been llvm::sys::TimeValue, llvm::TimeValue makes no sense. llvm-svn: 171292
* Begin sketching out the process interface.Chandler Carruth2012-12-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | The coding style used here is not LLVM's style because this is modeled after a Boost interface and thus done in the style of a candidate C++ standard library interface. I'll probably end up proposing it as a standard C++ library if it proves to be reasonably portable and useful. This is just the most basic parts of the interface -- getting the process ID out of it. However, it helps sketch out some of the boiler plate such as the base class, derived class, shared code, and static factory function. It also introduces a unittest so that I can incrementally ensure this stuff works. However, I've not even compiled this code for Windows yet. I'll try to fix any Windows fallout from the bots, and if I can't fix it I'll revert and get someone on Windows to help out. There isn't a lot more that is mandatory, so soon I'll switch to just stubbing out the Windows side and get Michael Spencer to help with implementation as he can test it directly. llvm-svn: 171289
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-3/+3
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Try to unbreak the windows build.Benjamin Kramer2012-07-201-1/+1
| | | | llvm-svn: 160567
* Process: Add sys::Process::FileDescriptorHasColors().Daniel Dunbar2012-07-201-4/+8
| | | | llvm-svn: 160557
* Remove tabs.Bill Wendling2012-07-191-1/+1
| | | | llvm-svn: 160476
* Reapply 'Add reverseColor to raw_ostream'.Benjamin Kramer2012-04-161-0/+32
| | | | | | | To be used in printing unprintable source in clang diagnostics. Patch by Seth Cantrell, with a minor fix for mingw by me. llvm-svn: 154805
* Revert r154800 which breaks windows builders.Argyrios Kyrtzidis2012-04-161-33/+0
| | | | llvm-svn: 154802
* Add reverseColor to raw_ostream.Argyrios Kyrtzidis2012-04-161-0/+33
| | | | | | | To be used in printing unprintable source in clang diagnostics. Patch by Seth Cantrell! llvm-svn: 154800
* Remove SetWorkingDirectory from the Process interface. Nothing in LLVMChandler Carruth2012-01-151-4/+0
| | | | | | | | | | | | or Clang is using this, and it would be hard to use it correctly given the thread hostility of the function. Also, it never checked the return which is rather dangerous with chdir. If someone was in fact using this, please let me know, as well as what the usecase actually is so that I can add it back and make it more correct and secure to use. (That said, it's never going to be "safe" per-se, but we could at least document the risks...) llvm-svn: 148211
* sys::Process: Add a SetWorkingDirectory method.Daniel Dunbar2011-09-231-0/+5
| | | | llvm-svn: 140433
* Merge System into Support.Michael J. Spencer2010-11-291-0/+222
llvm-svn: 120298
OpenPOWER on IntegriCloud