Advertisement
Guest User

bartus

a guest
Mar 16th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. commit 5e4b7cbebfec001c27bbc3c96786441437bd4c5c
  2. Author: bartus <szczepaniak.bartek+github@gmail.com>
  3. Date: Fri Mar 15 17:17:48 2019 +0100
  4.  
  5. fix new version
  6.  
  7. 1. fix missing submodule init
  8. 2. fix perf_record_sample enum scope
  9. 3. use system protoc (protobuff)
  10.  
  11. diff --git a/PKGBUILD b/PKGBUILD
  12. index 3bfb64c..162e6c6 100644
  13. --- a/PKGBUILD
  14. +++ b/PKGBUILD
  15. @@ -2,34 +2,59 @@
  16.  
  17. _pkgname=autofdo
  18. pkgname=$_pkgname-git
  19. -pkgver=v0.1.r63.cf651b8
  20. +pkgver=v0.1.r88.492384d
  21. pkgrel=1
  22. pkgdesc="a tool to convert perf.data profile to AutoFDO profile that can be used by GCC and LLVM"
  23. arch=('x86_64')
  24. url="https://github.com/google/autofdo"
  25. license=('Apache')
  26. depends=()
  27. -makedepends=('git' 'llvm')
  28. +makedepends=('git' 'llvm' 'protobuf') #use system protoc instad of building one
  29. optdepends=('llvm: for LLVM support')
  30. +options=('!makeflags')
  31. provides=("${_pkgname}")
  32. conflicts=("${_pkgname}")
  33. -source=("$_pkgname::git+$url")
  34. -md5sums=('SKIP')
  35. +source=("$_pkgname::git+$url"
  36. + "git+https://github.com/google/perf_data_converter.git"
  37. + "git+https://github.com/protocolbuffers/protobuf.git"
  38. + "perf_record_sample.patch")
  39. +md5sums=('SKIP'
  40. + 'SKIP'
  41. + 'SKIP'
  42. + '21be9ec59b57bb740c3c5af777f67558')
  43.  
  44. pkgver() {
  45. cd "$srcdir/${_pkgname}"
  46. printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
  47. }
  48.  
  49. +prepare() {
  50. + cd ${srcdir}/${_pkgname}
  51. +# initialize submodules
  52. + git config submodule.third_party/perf_data_converter.url ${srcdir}/perf_data_converter
  53. + git config submodule.third_party/protobuf.url ${srcdir}/protobuf
  54. + git submodule update --init --recursive --remote
  55. +# apply patches
  56. + git apply -v ${srcdir}/perf_record_sample.patch
  57. +# initialize autoconf build system
  58. + aclocal -I .
  59. + autoheader
  60. + autoconf
  61. + automake --add-missing -c
  62. +}
  63. +
  64. build() {
  65. cd "$srcdir/${_pkgname}"
  66. +# configure build
  67. ./configure \
  68. --prefix=/usr \
  69. - --with-llvm=/usr/lib
  70. + --with-llvm=$(which llvm-config)
  71. +# build
  72. make
  73. }
  74.  
  75. package() {
  76. cd "$srcdir/${_pkgname}"
  77. +# install
  78. make DESTDIR="$pkgdir/" install
  79. }
  80. diff --git a/perf_record_sample.patch b/perf_record_sample.patch
  81. new file mode 100644
  82. index 0000000..06036ce
  83. --- /dev/null
  84. +++ b/perf_record_sample.patch
  85. @@ -0,0 +1,13 @@
  86. +diff --git a/sample_reader.cc b/sample_reader.cc
  87. +index 3071582..4b27185 100644
  88. +--- a/sample_reader.cc
  89. ++++ b/sample_reader.cc
  90. +@@ -212,7 +212,7 @@ bool PerfDataSampleReader::Append(const string &profile_file) {
  91. + // focus_binary_re_ is used to match the binary name with the samples.
  92. + for (const auto &event : parser.parsed_events()) {
  93. + if (!event.event_ptr ||
  94. +- event.event_ptr->header().type() != PERF_RECORD_SAMPLE) {
  95. ++ event.event_ptr->header().type() != quipper::PERF_RECORD_SAMPLE) {
  96. + continue;
  97. + }
  98. + if (MatchBinary(event.dso_and_offset.dso_name(), focus_binary)) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement