hostinfo.hh revision 56
16285Snate@binkert.org/*
26145Snate@binkert.org * Copyright (c) 2003 The Regents of The University of Michigan
36239Snate@binkert.org * All rights reserved.
46239Snate@binkert.org *
56145Snate@binkert.org * Redistribution and use in source and binary forms, with or without
66239Snate@binkert.org * modification, are permitted provided that the following conditions are
76239Snate@binkert.org * met: redistributions of source code must retain the above copyright
86239Snate@binkert.org * notice, this list of conditions and the following disclaimer;
96239Snate@binkert.org * redistributions in binary form must reproduce the above copyright
106239Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
116239Snate@binkert.org * documentation and/or other materials provided with the distribution;
126239Snate@binkert.org * neither the name of the copyright holders nor the names of its
136239Snate@binkert.org * contributors may be used to endorse or promote products derived from
146239Snate@binkert.org * this software without specific prior written permission.
156239Snate@binkert.org *
166145Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
176239Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
186239Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
196239Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
206239Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
216239Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
226239Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
236239Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
246239Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
256239Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
266239Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
276239Snate@binkert.org */
286145Snate@binkert.org
296145Snate@binkert.org#ifndef __HOSTINFO_HH__
306285Snate@binkert.org#define __HOSTINFO_HH__
316285Snate@binkert.org
326285Snate@binkert.org#include "sim/host.hh"
336285Snate@binkert.org
346145Snate@binkert.orguint64_t procInfo(char *filename, char *target);
356145Snate@binkert.org
366145Snate@binkert.orginline uint64_t memUsage()
376145Snate@binkert.org{ return procInfo("/proc/self/status", "VmSize:"); }
386154Snate@binkert.org
396285Snate@binkert.org#endif // __HOSTINFO_HH__
406154Snate@binkert.org