| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/debugger/qqmlmemoryprofiler.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | QQmlMemoryScope::LibraryState QQmlMemoryScope::state = QQmlMemoryScope::Unloaded; | - | ||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | typedef void (qmlmemprofile_stats)(int *allocCount, int *bytesAllocated); | - | ||||||||||||||||||||||||
| 8 | typedef void (qmlmemprofile_clear)(); | - | ||||||||||||||||||||||||
| 9 | typedef void (qmlmemprofile_enable)(); | - | ||||||||||||||||||||||||
| 10 | typedef void (qmlmemprofile_disable)(); | - | ||||||||||||||||||||||||
| 11 | typedef void (qmlmemprofile_push_location)(const char *filename, int lineNumber); | - | ||||||||||||||||||||||||
| 12 | typedef void (qmlmemprofile_pop_location)(); | - | ||||||||||||||||||||||||
| 13 | typedef void (qmlmemprofile_save)(const char *filename); | - | ||||||||||||||||||||||||
| 14 | typedef int (qmlmemprofile_is_enabled)(); | - | ||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | static qmlmemprofile_stats *memprofile_stats; | - | ||||||||||||||||||||||||
| 17 | static qmlmemprofile_clear *memprofile_clear; | - | ||||||||||||||||||||||||
| 18 | static qmlmemprofile_enable *memprofile_enable; | - | ||||||||||||||||||||||||
| 19 | static qmlmemprofile_disable *memprofile_disable; | - | ||||||||||||||||||||||||
| 20 | static qmlmemprofile_push_location *memprofile_push_location; | - | ||||||||||||||||||||||||
| 21 | static qmlmemprofile_pop_location *memprofile_pop_location; | - | ||||||||||||||||||||||||
| 22 | static qmlmemprofile_save *memprofile_save; | - | ||||||||||||||||||||||||
| 23 | static qmlmemprofile_is_enabled *memprofile_is_enabled; | - | ||||||||||||||||||||||||
| 24 | - | |||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||
| 26 | extern QFunctionPointer qt_linux_find_symbol_sys(const char *symbol); | - | ||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||
| 29 | bool QQmlMemoryScope::doOpenLibrary() | - | ||||||||||||||||||||||||
| 30 | { | - | ||||||||||||||||||||||||
| 31 | - | |||||||||||||||||||||||||
| 32 | if (state == Unloaded
| 0-336 | ||||||||||||||||||||||||
| 33 | memprofile_stats = (qmlmemprofile_stats *) qt_linux_find_symbol_sys("qmlmemprofile_stats"); | - | ||||||||||||||||||||||||
| 34 | memprofile_clear = (qmlmemprofile_clear *) qt_linux_find_symbol_sys("qmlmemprofile_clear"); | - | ||||||||||||||||||||||||
| 35 | memprofile_enable = (qmlmemprofile_enable *) qt_linux_find_symbol_sys("qmlmemprofile_enable"); | - | ||||||||||||||||||||||||
| 36 | memprofile_disable = (qmlmemprofile_disable *) qt_linux_find_symbol_sys("qmlmemprofile_disable"); | - | ||||||||||||||||||||||||
| 37 | memprofile_push_location = (qmlmemprofile_push_location *) qt_linux_find_symbol_sys("qmlmemprofile_push_location"); | - | ||||||||||||||||||||||||
| 38 | memprofile_pop_location = (qmlmemprofile_pop_location *) qt_linux_find_symbol_sys("qmlmemprofile_pop_location"); | - | ||||||||||||||||||||||||
| 39 | memprofile_save = (qmlmemprofile_save *) qt_linux_find_symbol_sys("qmlmemprofile_save"); | - | ||||||||||||||||||||||||
| 40 | memprofile_is_enabled = (qmlmemprofile_is_enabled *) qt_linux_find_symbol_sys("qmlmemprofile_is_enabled"); | - | ||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||
| 42 | if (memprofile_stats
| 0-336 | ||||||||||||||||||||||||
| 43 | memprofile_push_location
| 0 | ||||||||||||||||||||||||
| 44 | state = Loaded; never executed: state = Loaded; | 0 | ||||||||||||||||||||||||
| 45 | else | - | ||||||||||||||||||||||||
| 46 | state = Failed; executed 336 times by 152 tests: state = Failed;Executed by:
| 336 | ||||||||||||||||||||||||
| 47 | } | - | ||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||
| 49 | - | |||||||||||||||||||||||||
| 50 | return executed 336 times by 152 tests: state == Loaded;return state == Loaded;Executed by:
executed 336 times by 152 tests: return state == Loaded;Executed by:
| 336 | ||||||||||||||||||||||||
| 51 | } | - | ||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||
| 53 | void QQmlMemoryScope::init(const char *string) | - | ||||||||||||||||||||||||
| 54 | { | - | ||||||||||||||||||||||||
| 55 | if (memprofile_is_enabled()
| 0 | ||||||||||||||||||||||||
| 56 | memprofile_push_location(string, 0); | - | ||||||||||||||||||||||||
| 57 | pushed = true; | - | ||||||||||||||||||||||||
| 58 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 59 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||
| 61 | void QQmlMemoryScope::done() | - | ||||||||||||||||||||||||
| 62 | { | - | ||||||||||||||||||||||||
| 63 | memprofile_pop_location(); | - | ||||||||||||||||||||||||
| 64 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 65 | - | |||||||||||||||||||||||||
| 66 | bool QQmlMemoryProfiler::isEnabled() | - | ||||||||||||||||||||||||
| 67 | { | - | ||||||||||||||||||||||||
| 68 | if (QQmlMemoryScope::openLibrary()
| 0 | ||||||||||||||||||||||||
| 69 | return never executed: memprofile_is_enabled();return memprofile_is_enabled();never executed: return memprofile_is_enabled(); | 0 | ||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 72 | } | - | ||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||
| 74 | void QQmlMemoryProfiler::enable() | - | ||||||||||||||||||||||||
| 75 | { | - | ||||||||||||||||||||||||
| 76 | if (QQmlMemoryScope::openLibrary()
| 0 | ||||||||||||||||||||||||
| 77 | memprofile_enable(); never executed: memprofile_enable(); | 0 | ||||||||||||||||||||||||
| 78 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||
| 80 | void QQmlMemoryProfiler::disable() | - | ||||||||||||||||||||||||
| 81 | { | - | ||||||||||||||||||||||||
| 82 | if (QQmlMemoryScope::openLibrary()
| 0 | ||||||||||||||||||||||||
| 83 | memprofile_disable(); never executed: memprofile_disable(); | 0 | ||||||||||||||||||||||||
| 84 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||
| 86 | void QQmlMemoryProfiler::clear() | - | ||||||||||||||||||||||||
| 87 | { | - | ||||||||||||||||||||||||
| 88 | if (QQmlMemoryScope::openLibrary()
| 0 | ||||||||||||||||||||||||
| 89 | memprofile_clear(); never executed: memprofile_clear(); | 0 | ||||||||||||||||||||||||
| 90 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||
| 92 | void QQmlMemoryProfiler::stats(int *allocCount, int *bytesAllocated) | - | ||||||||||||||||||||||||
| 93 | { | - | ||||||||||||||||||||||||
| 94 | if (QQmlMemoryScope::openLibrary()
| 0 | ||||||||||||||||||||||||
| 95 | memprofile_stats(allocCount, bytesAllocated); never executed: memprofile_stats(allocCount, bytesAllocated); | 0 | ||||||||||||||||||||||||
| 96 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 97 | - | |||||||||||||||||||||||||
| 98 | void QQmlMemoryProfiler::save(const char *filename) | - | ||||||||||||||||||||||||
| 99 | { | - | ||||||||||||||||||||||||
| 100 | if (QQmlMemoryScope::openLibrary()
| 0 | ||||||||||||||||||||||||
| 101 | memprofile_save(filename); never executed: memprofile_save(filename); | 0 | ||||||||||||||||||||||||
| 102 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |