summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/monitordisk.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: bitbake: Drop duplicate license boilerplace textRichard Purdie2019-06-191-12/+0
| | | | | | | | | | | | With the introduction of SPDX-License-Identifier headers, we don't need a ton of header boilerplate in every file. Simplify the files and rely on the top level for the full licence text. (Bitbake rev: 34ed28a412af642a993642c14bd8b95d5ef22cd8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Add initial pass of SPDX license headers to source codeRichard Purdie2019-06-191-0/+2
| | | | | | | | | | | | | | | | | | | This adds the SPDX-License-Identifier license headers to the majority of our source files to make it clearer exactly which license files are under. The bulk of the files are under GPL v2.0 with one found to be under V2.0 or later, some under MIT and some have dual license. There are some files which are potentially harder to classify where we've imported upstream code and those can be handled specifically in later commits. The COPYING file is replaced with LICENSE.X files which contain the full license texts. (Bitbake rev: ac556588fac55e91b7ce4839a975eb9ebb5aa192) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Fix Deprecated warnings from regexsRichard Purdie2019-01-161-6/+6
| | | | | | | | | Fix handling of escape characters in regexs and hence fix python Deprecation warnings which will be problematic in python 3.8. (Bitbake rev: c1fcc46e2498ddd41425d8756754f814d682aba3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: monitordisk: add eventPatrick Ohly2016-12-071-0/+8
| | | | | | | | | | | | | | | | | | | The current disk usage is interesting and may be worth logging over time as part of the build statistics. Instead of re-implementing the code and the configuration option (BB_DISKMON_DIRS), the information gathered by monitordisk.py is made available to buildstats.bbclass via a new event. This has pros and cons: - there is already a useful default configuration for "interesting" directories - no code duplication - on the other hand, users cannot configure recording separately from monitoring (probably not that important) (Bitbake rev: f065ac17d0031dca6309ddbff18c8792630de865) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: monitordisk.py: minor code and comment cleanupPatrick Ohly2016-12-071-9/+6
| | | | | | | | | | | | | There's no need to encode and decode the hash key as a single string, a tuple works just fine. Iterating over entries can be written more concisely. Entries in the stat results are integers, not floating point values. (Bitbake rev: 3c943e989964382c0b819d92de26a0c914ebed33) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: remove True option to getVar callsJoshua Lock2016-11-301-2/+2
| | | | | | | | | | | | getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (Bitbake rev: 3b45c479de8640f92dd1d9f147b02e1eecfaadc8) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Update logger.warn() -> logger.warning()Richard Purdie2016-05-111-2/+2
| | | | | | | | | | python deprecated logger.warn() in favour of logger.warning(). This is only used in bitbake code so we may as well just translate everything to avoid warnings under python 3. Its safe for python 2.7. (Bitbake rev: 676a5f592e8507e81b8f748d58acfea7572f8796) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: monitordisk: don't log when not monitoring a filesystem for inodesRoss Burton2014-09-291-4/+2
| | | | | | | | | | | | Writing a log that the filesystem isn't being monitored for inode usage just confuses users who are not aware about the nature of inodes in their filesystem, so don't say anything, just silently disable the monitor. In general this only happens on filesystems which don't have a limit on inodes. (Bitbake rev: ca93bc84ee5fb94a50c11c47e4d212d7da649e24) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb/*.py: Typo fixes/grammar/comment fixes, nothing functional.Robert P. J. Day2014-08-251-6/+6
| | | | | | | (Bitbake rev: 587b144ee409d444494d8d7f2d1c53ede8f7c953) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: monitordisk: lower inode check warning to noteOlof Johansson2013-10-181-1/+1
| | | | | | | | | | | Filesystems like btrfs and reiserfs sets the inode count to 0, since they don't have an inode concept. This is expected, and having a warning show up every time you run bitbake can cause undue concern. (Bitbake rev: f3ac2d3678f48c68a250a0a20c08cf8687322d38) Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb/monitordisk.py: fix spelling in error textErik Botö2013-10-021-2/+2
| | | | | | | (Bitbake rev: 78efda1224a99ed3d2ca6befb9fd719d82f6b0ae) Signed-off-by: Erik Botö <erik.boto@pelagicore.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: monitordisk.py: disable inode checking for btrfsRobert Yang2013-04-151-1/+1
| | | | | | | | | | | | | | | | | | | The btrfs doesn't have static inode, so disable the inode check for it, the previouse patch has set it: minInode = None But this is incorrect, the minInode is just a temporary variable, it should be: self.devDict[k][2] = None [YOCTO #3609] (Bitbake rev: 7e45149c292bc92314af9b42962fde8f603a179f) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: monitordisk.py: monitor disks based on pathRobert Yang2013-03-191-32/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous monitor is based on the disk, and one disk only can have one action, this limits its function, for example we set this in the current local.conf: BB_DISKMON_DIRS = "\ STOPTASKS,${TMPDIR},1G,100K \ STOPTASKS,${DL_DIR},1G,100K \ STOPTASKS,${SSTATE_DIR},1G,100K \ ABORT,${TMPDIR},100M,1K \ ABORT,${DL_DIR},100M,1K \ ABORT,${SSTATE_DIR},100GM,1K" Before: * If TMPDIR, DL_DIR and SSTATE_DIR are on the same disk partition, only the last line "ABORT,${SSTATE_DIR},100GM,1K" works * If TMPDIR, DL_DIR and SSTATE_DIR are on the different disk partitions, only the last three lines (ABORT) work. These are not what we expect, now: * We monitor the disk based on the path and action, so all the six lines will work no matter whether they are on the same disk partition or not. * The out put format will be: WARNING: The free space of /path/to/directory (device) is running low (XXGB left) [YOCTO #3995] (Bitbake rev: e22a576672ee4a40b44f7a826a78a77fc07e9177) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: monitordisk.py: disable the inode checking for some fsRobert Yang2013-02-151-1/+8
| | | | | | | | | | | | | | | | | There is an error when use disk monitor on btrfs: WARNING: The free inode of rootfs is running low (0.000K left) ERROR: Immediately abort since the disk space monitor action is "ABORT"! This is beucase some fs formats' statvfs.f_files (inodes) is zero, thus the statvfs.f_favail (free inodes) is zero, too, this a feature of the fs, we disable the inode checking for such a fs. [YOCTO #3609] (Bitbake rev: b2ada3ad5f7aefff107f013e0c9decea481c7ef6) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: monitordisk: fire event DISKFULL when terminate buildKang Kai2012-08-021-0/+5
| | | | | | | | | | | | | | | Part of [Yocto #2168] Add a event DiskFull to descript the termination by disk monitor. Update check() to fire the event DiskFull when terminates the build. This could help UIs to deal this scenario and show more information to end user. (Bitbake rev: 0a0fca3d94a1db6458ae21501a66461a334410ed) Signed-off-by: Kang Kai <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* diskspace monitor: assign a default value when only of the interval is setRobert Yang2012-04-111-2/+9
| | | | | | | | | | | | | | | | | | | Assign a default value to the other one when either disk space interval or amount of inodes interval value is set for example: BB_DISKMON_WARNINTERVAL = "50M," or BB_DISKMON_WARNINTERVAL = ",5K" The diskspace monitor would not enable in the past, that seemed unreasonable, assign a default value to the other one currently, so the monitor will be enabled, and will warn both of diskspace and free amount of inode if they have been set in BB_DISKMON_DIRS. (Bitbake rev: 09592c119550550edcc59c871f754536d5b7bf65) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/classes: Convert to use appendVar and appendVarFlagsRichard Purdie2012-03-051-2/+2
| | | | | | (From OE-Core rev: 3b57de68e70e77dbc03c0616a83a29a2e99e40b4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* V5 Disk space monitoringRobert Yang2012-02-261-0/+237
Monitor disk availability and take action when the free disk space or amount of free inode is running low, it is enabled when BB_DISKMON_DIRS is set. * Variable meanings(from meta-yocto/conf/local.conf.sample): # Set the directories to monitor for disk usage, if more than one # directories are mounted in the same device, then only one directory # would be monitored since the monitor is based on the device. # The format is: # "action,directory,minimum_space,minimum_free_inode" # # The "action" must be set and should be one of: # ABORT: Immediately abort # STOPTASKS: The new tasks can't be executed any more, will stop the build # when the running tasks have been done. # WARN: show warnings (see BB_DISKMON_WARNINTERVAL for more information) # # The "directory" must be set, any directory is OK. # # Either "minimum_space" or "minimum_free_inode" (or both of them) # should be set, otherwise the monitor would not be enabled, # the unit can be G, M, K or none, but do NOT use GB, MB or KB # (B is not needed). #BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K" # # Set disk space and inode interval (only works when the action is "WARN", # the unit can be G, M, or K, but do NOT use the GB, MB or KB # (B is not needed), the format is: # "disk_space_interval, disk_inode_interval", the default value is # "50M,5K" which means that it would warn when the free space is # lower than the minimum space(or inode), and would repeat the action # when the disk space reduces 50M (or the amount of inode reduces 5k) # again. #BB_DISKMON_WARNINTERVAL = "50M,5K" [YOCTO #1589] (Bitbake rev: 4d173d441d2beb8e6492b6b1842682f8cf32e6cc) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>