From fcdc2d5b91b2c3706d60772183d18858b6c30904 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Sun, 15 Mar 2020 19:10:43 +0800 Subject: [PATCH] Initial release --- .gitignore | 1 + memstrack.spec | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 68 insertions(+) create mode 100644 .gitignore create mode 100644 memstrack.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e07e7d2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/memstrack-ee02de2.tar.gz diff --git a/memstrack.spec b/memstrack.spec new file mode 100644 index 0000000..8cbad0a --- /dev/null +++ b/memstrack.spec @@ -0,0 +1,66 @@ +# vim: syntax=spec +%global gitcommit ee02de283fec5499639751deb6c0d7848fba986c +%global gitshortcommit %(c=%{gitcommit}; echo ${c:0:7}) +%global snapshotdate 20200310 + +# keep dracutlibdir consistent with the definition in dracut.spec +%global dracutlibdir %{_prefix}/lib/dracut +%global dracutmoduledir %{dracutlibdir}/modules.d/99memstrack + +Name: memstrack +Version: 0 +Release: 1.%{snapshotdate}git%{gitshortcommit}%{?dist} +Summary: A memory allocation tracer, like a hot spot analyzer for memory allocation +License: GPLv3 +URL: https://github.com/ryncsn/memstrack +VCS: git+git@github.com:ryncsn/memstrack.git +BuildRequires: gcc +BuildRequires: ncurses-devel + +Source: https://github.com/ryncsn/memstrack/archive/%{gitcommit}/memstrack-%{gitshortcommit}.tar.gz + +%description +A memory allocation tracer, like a hot spot analyzer for memory allocation + +%package dracut +Summary: Debug hook for analyzing memory with memstract in dracut +Requires: %{name} = %{version}-%{release} +Requires: dracut +BuildArch: noarch + +%description dracut +Debug hook for analyzing memory with memstract in dracut, help analyze +booting stage memory usage. + +%prep +%setup -q -n memstrack-%{gitcommit} + +%build +%{set_build_flags} +make %{?_smp_mflags} + +%install +mkdir -p %{buildroot}/%{_bindir} +install -p -m 755 memstrack %{buildroot}/%{_bindir} + +mkdir -p %{buildroot}/%{dracutmoduledir} +install -p -m 644 misc/99memstrack/memstrack.service %{buildroot}/%{dracutmoduledir}/memstrack.service +install -p -m 755 misc/99memstrack/module-setup.sh %{buildroot}/%{dracutmoduledir}/module-setup.sh +install -p -m 755 misc/99memstrack/start-tracing.sh %{buildroot}/%{dracutmoduledir}/start-tracing.sh +install -p -m 755 misc/99memstrack/stop-tracing.sh %{buildroot}/%{dracutmoduledir}/stop-tracing.sh + +%files +%doc README.md +%license LICENSE +%{_bindir}/memstrack + +%files dracut +%dir %{dracutmoduledir} +%{dracutmoduledir}/memstrack.service +%{dracutmoduledir}/module-setup.sh +%{dracutmoduledir}/start-tracing.sh +%{dracutmoduledir}/stop-tracing.sh + +%changelog +* Sun Mar 15 2020 Kairui Song - 0-1.20200310gitee02de2 +- First release diff --git a/sources b/sources new file mode 100644 index 0000000..dc2bc92 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (memstrack-ee02de2.tar.gz) = a0d8086cbca571f3a63a242fb4b6d74c6c0645abf279bbcee9f39aaedb714bfc5e2b443aad3f7be75ed34426b4520e1a36d397ca064493bc4ea0916a1c3f7729