···243243244244</section>
245245246246+<section xml:id="sec-declarative-package-management">
247247+ <title>Declarative Package Management</title>
248248+249249+ <section xml:id="sec-building-environment">
250250+ <title>Build an environment</title>
251251+252252+ <para>
253253+ Using <literal>packageOverrides</literal>, it is possible to manage
254254+ packages declaratively. This means that we can list all of our desired
255255+ packages within a declarative Nix expression. For example, to have
256256+ <literal>aspell</literal>, <literal>bc</literal>,
257257+ <literal>ffmpeg</literal>, <literal>coreutils</literal>,
258258+ <literal>gdb</literal>, <literal>nixUnstable</literal>,
259259+ <literal>emscripten</literal>, <literal>jq</literal>,
260260+ <literal>nox</literal>, and <literal>silver-searcher</literal>, we could
261261+ use the following in <filename>~/.config/nixpkgs/config.nix</filename>:
262262+ </para>
263263+264264+ <screen>
265265+{
266266+ packageOverrides = pkgs: with pkgs; {
267267+ myPackages = pkgs.buildEnv {
268268+ name = "my-packages";
269269+ paths = [ aspell bc coreutils gdb ffmpeg nixUnstable emscripten jq nox silver-searcher ];
270270+ };
271271+ };
272272+}
273273+ </screen>
274274+275275+ <para>
276276+ To install it into our environment, you can just run <literal>nix-env -iA
277277+ nixpkgs.myPackages</literal>. If you want to load the packages to be built
278278+ from a working copy of <literal>nixpkgs</literal> you just run
279279+ <literal>nix-env -f. -iA myPackages</literal>. To explore what's been
280280+ installed, just look through <filename>~/.nix-profile/</filename>. You can
281281+ see that a lot of stuff has been installed. Some of this stuff is useful
282282+ some of it isn't. Let's tell Nixpkgs to only link the stuff that we want:
283283+ </para>
284284+285285+ <screen>
286286+{
287287+ packageOverrides = pkgs: with pkgs; {
288288+ myPackages = pkgs.buildEnv {
289289+ name = "my-packages";
290290+ paths = [ aspell bc coreutils gdb ffmpeg nixUnstable emscripten jq nox silver-searcher ];
291291+ pathsToLink = [ "/share" "/bin" ];
292292+ };
293293+ };
294294+}
295295+ </screen>
296296+297297+ <para>
298298+ <literal>pathsToLink</literal> tells Nixpkgs to only link the paths listed
299299+ which gets rid of the extra stuff in the profile.
300300+ <filename>/bin</filename> and <filename>/share</filename> are good
301301+ defaults for a user environment, getting rid of the clutter. If you are
302302+ running on Nix on MacOS, you may want to add another path as well,
303303+ <filename>/Applications</filename>, that makes GUI apps available.
304304+ </para>
305305+306306+ </section>
307307+308308+ <section xml:id="sec-getting-documentation">
309309+ <title>Getting documentation</title>
310310+311311+ <para>
312312+ After building that new environment, look through
313313+ <filename>~/.nix-profile</filename> to make sure everything is there that
314314+ we wanted. Discerning readers will note that some files are missing. Look
315315+ inside <filename>~/.nix-profile/share/man/man1/</filename> to verify this.
316316+ There are no man pages for any of the Nix tools! This is because some
317317+ packages like Nix have multiple outputs for things like documentation (see
318318+ section 4). Let's make Nix install those as well.
319319+ </para>
320320+321321+ <screen>
322322+{
323323+ packageOverrides = pkgs: with pkgs; {
324324+ myPackages = pkgs.buildEnv {
325325+ name = "my-packages";
326326+ paths = [ aspell bc coreutils ffmpeg nixUnstable emscripten jq nox silver-searcher ];
327327+ pathsToLink = [ "/share/man" "/share/doc" /bin" ];
328328+ extraOutputsToInstall = [ "man" "doc" ];
329329+ };
330330+ };
331331+}
332332+ </screen>
333333+334334+ <para>
335335+ This provides us with some useful documentation for using our packages.
336336+ However, if we actually want those manpages to be detected by man, we need
337337+ to set up our environment. This can also be managed within Nix
338338+ expressions.
339339+ </para>
340340+341341+ <screen>
342342+{
343343+ packageOverrides = pkgs: with pkgs; rec {
344344+ myProfile = writeText "my-profile" ''
345345+export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
346346+export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
347347+ '';
348348+ myPackages = pkgs.buildEnv {
349349+ name = "my-packages";
350350+ paths = [
351351+ (runCommand "profile" {} ''
352352+mkdir -p $out/etc/profile.d
353353+cp ${myProfile} $out/etc/profile.d/my-profile.sh
354354+ '')
355355+ aspell
356356+ bc
357357+ coreutils
358358+ ffmpeg
359359+ man
360360+ nixUnstable
361361+ emscripten
362362+ jq
363363+ nox
364364+ silver-searcher
365365+ ];
366366+ pathsToLink = [ "/share/man" "/share/doc" /bin" "/etc" ];
367367+ extraOutputsToInstall = [ "man" "doc" ];
368368+ };
369369+ };
370370+}
371371+ </screen>
372372+373373+ <para>
374374+ For this to work fully, you must also have this script sourced when you
375375+ are logged in. Try adding something like this to your
376376+ <filename>~/.profile</filename> file:
377377+ </para>
378378+379379+ <screen>
380380+#!/bin/sh
381381+if [ -d $HOME/.nix-profile/etc/profile.d ]; then
382382+ for i in $HOME/.nix-profile/etc/profile.d/*.sh; do
383383+ if [ -r $i ]; then
384384+ . $i
385385+ fi
386386+ done
387387+fi
388388+ </screen>
389389+390390+ <para>
391391+ Now just run <literal>source $HOME/.profile</literal> and you can starting
392392+ loading man pages from your environent.
393393+ </para>
394394+395395+ </section>
396396+397397+ <section xml:id="sec-gnu-info-setup">
398398+ <title>GNU info setup</title>
399399+400400+ <para>
401401+ Configuring GNU info is a little bit trickier than man pages. To work
402402+ correctly, info needs a database to be generated. This can be done with
403403+ some small modifications to our environment scripts.
404404+ </para>
405405+406406+ <screen>
407407+{
408408+ packageOverrides = pkgs: with pkgs; rec {
409409+ myProfile = writeText "my-profile" ''
410410+export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
411411+export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
412412+export INFOPATH=$HOME/.nix-profile/share/info:/nix/var/nix/profiles/default/share/info:/usr/share/info
413413+ '';
414414+ myPackages = pkgs.buildEnv {
415415+ name = "my-packages";
416416+ paths = [
417417+ (runCommand "profile" {} ''
418418+mkdir -p $out/etc/profile.d
419419+cp ${myProfile} $out/etc/profile.d/my-profile.sh
420420+ '')
421421+ aspell
422422+ bc
423423+ coreutils
424424+ ffmpeg
425425+ man
426426+ nixUnstable
427427+ emscripten
428428+ jq
429429+ nox
430430+ silver-searcher
431431+ texinfoInteractive
432432+ ];
433433+ pathsToLink = [ "/share/man" "/share/doc" "/share/info" "/bin" "/etc" ];
434434+ extraOutputsToInstall = [ "man" "doc" "info" ];
435435+ postBuild = ''
436436+ if [ -x $out/bin/install-info -a -w $out/share/info ]; then
437437+ shopt -s nullglob
438438+ for i in $out/share/info/*.info $out/share/info/*.info.gz; do
439439+ $out/bin/install-info $i $out/share/info/dir
440440+ done
441441+ fi
442442+ '';
443443+ };
444444+ };
445445+}
446446+ </screen>
447447+448448+ <para>
449449+ <literal>postBuild</literal> tells Nixpkgs to run a command after building
450450+ the environment. In this case, <literal>install-info</literal> adds the
451451+ installed info pages to <literal>dir</literal> which is GNU info's default
452452+ root node. Note that <literal>texinfoInteractive</literal> is added to the
453453+ environment to give the <literal>install-info</literal> command.
454454+ </para>
455455+456456+ </section>
457457+458458+</section>
246459247460</chapter>
+1
maintainers/scripts/update-python-libraries
···9191 if release['filename'].endswith(extension):
9292 # TODO: In case of wheel we need to do further checks!
9393 sha256 = release['digests']['sha256']
9494+ break
9495 else:
9596 sha256 = None
9697 return version, sha256
+17-1
nixos/doc/manual/release-notes/rl-1709.xml
···8686 </listitem>
8787 <listitem>
8888 <para>
8989+ The following changes apply if the <literal>stateVersion</literal> is changed to 17.09 or higher.
9090+ For <literal>stateVersion = "17.03</literal> or lower the old behavior is preserved.
9191+ </para>
9292+ <para>
8993 The <literal>postgres</literal> default version was changed from 9.5 to 9.6.
9094 </para>
9195 <para>
···9397 </para>
9498 <para>
9599 The <literal>postgres</literal> default <literal>dataDir</literal> has changed from <literal>/var/db/postgres</literal> to <literal>/var/lib/postgresql/$psqlSchema</literal> where $psqlSchema is 9.6 for example.
100100+ </para>
101101+ <para>
102102+ The <literal>mysql</literal> default <literal>dataDir</literal> has changed from <literal>/var/mysql</literal> to <literal>/var/lib/mysql</literal>.
96103 </para>
97104 </listitem>
98105 <listitem>
···113120 also serve as a SSH agent if <literal>enableSSHSupport</literal> is set.
114121 </para>
115122 </listitem>
123123+ <listitem>
124124+ <para>
125125+ The <literal>services.tinc.networks.<name>.listenAddress</literal>
126126+ option had a misleading name that did not correspond to its behavior. It
127127+ now correctly defines the ip to listen for incoming connections on. To
128128+ keep the previous behaviour, use
129129+ <literal>services.tinc.networks.<name>.bindToAddress</literal>
130130+ instead. Refer to the description of the options for more details.
131131+ </para>
132132+ </listitem>
116133</itemizedlist>
117117-118134119135<para>Other notable improvements:</para>
120136
···448448 """
449449 Manage Taskserver users and certificates
450450 """
451451+ if not IS_AUTO_CONFIG:
452452+ return
451453 for path in (CA_KEY, CA_CERT, CRL_FILE):
452454 if not os.path.exists(path):
453455 msg = "CA setup not done or incomplete, missing file {}."
+11-2
nixos/modules/services/networking/tinc.nix
···7979 default = null;
8080 type = types.nullOr types.str;
8181 description = ''
8282- The ip adress to bind to.
8282+ The ip address to listen on for incoming connections.
8383+ '';
8484+ };
8585+8686+ bindToAddress = mkOption {
8787+ default = null;
8888+ type = types.nullOr types.str;
8989+ description = ''
9090+ The ip address to bind to (both listen on and send packets from).
8391 '';
8492 };
8593···131139 Name = ${if data.name == null then "$HOST" else data.name}
132140 DeviceType = ${data.interfaceType}
133141 ${optionalString (data.ed25519PrivateKeyFile != null) "Ed25519PrivateKeyFile = ${data.ed25519PrivateKeyFile}"}
134134- ${optionalString (data.listenAddress != null) "BindToAddress = ${data.listenAddress}"}
142142+ ${optionalString (data.listenAddress != null) "ListenAddress = ${data.listenAddress}"}
143143+ ${optionalString (data.bindToAddress != null) "BindToAddress = ${data.bindToAddress}"}
135144 Device = /dev/net/tun
136145 Interface = tinc.${network}
137146 ${data.extraConfig}
···33# has additional options that affect the web server as a whole, like
44# the user/group to run under.)
5566-{ lib }:
66+{ config, lib }:
7788with lib;
99{
···2626 '';
2727 };
28282929- port = mkOption {
3030- type = types.nullOr types.int;
3131- default = null;
2929+ listen = mkOption {
3030+ type = with types; listOf (submodule {
3131+ options = {
3232+ addr = mkOption { type = str; description = "IP address."; };
3333+ port = mkOption { type = nullOr int; description = "Port number."; };
3434+ };
3535+ });
3636+ default =
3737+ [ { addr = "0.0.0.0"; port = null; } ]
3838+ ++ optional config.networking.enableIPv6
3939+ { addr = "[::]"; port = null; };
4040+ example = [
4141+ { addr = "195.154.1.1"; port = 443; }
4242+ { addr = "192.168.1.2"; port = 443; }
4343+ ];
3244 description = ''
3333- Port for the server. Defaults to 80 for http
3434- and 443 for https (i.e. when enableSSL is set).
4545+ Listen addresses and ports for this virtual host.
4646+ IPv6 addresses must be enclosed in square brackets.
4747+ Setting the port to <literal>null</literal> defaults
4848+ to 80 for http and 443 for https (i.e. when enableSSL is set).
3549 '';
3650 };
3751
···246246 };
247247248248 subtest "check manual configuration", sub {
249249+ # Remove the keys from automatic CA creation, to make sure the new
250250+ # generation doesn't use keys from before.
251251+ $server->succeed('rm -rf ${cfg.dataDir}/keys/* >&2');
252252+249253 $server->succeed('${switchToNewServer} >&2');
250254 $server->waitForUnit("taskserver.service");
251255 $server->waitForOpenPort(${portStr});
···11{ lib, python3Packages, fetchFromGitHub, gtk3, cairo
22, aspellDicts, buildEnv
33, gnome3, hicolor_icon_theme
44-, xvfb_run, dbus
44+, xvfb_run, dbus, libnotify
55}:
6677python3Packages.buildPythonApplication rec {
88 name = "paperwork-${version}";
99 # Don't forget to also update paperwork-backend when updating this!
1010- version = "1.0.6.1";
1010+ version = "1.2";
11111212 src = fetchFromGitHub {
1313 repo = "paperwork";
1414 owner = "jflesch";
1515 rev = version;
1616- sha256 = "1v1lxyi4crdik4jlwjds9n6lzw4m4l4f9n5azlinv8wb477qpv6h";
1616+ sha256 = "1cb9wnhhpm3dyxjrkyl9bbva56xx85vlwlb7z07m1icflcln14x5";
1717 };
18181919 # Patch out a few paths that assume that we're using the FHS:
···4747 }}/lib/aspell";
48484949 checkInputs = [ xvfb_run dbus.daemon ];
5050- buildInputs = [ gnome3.defaultIconTheme hicolor_icon_theme ];
5050+ buildInputs = [ gnome3.defaultIconTheme hicolor_icon_theme libnotify ];
51515252 # A few parts of chkdeps need to have a display and a dbus session, so we not
5353 # only need to run a virtual X server + dbus but also have a large enough
···5959 '';
60606161 propagatedBuildInputs = with python3Packages; [
6262- paperwork-backend pypillowfight gtk3 cairo
6262+ paperwork-backend pypillowfight gtk3 cairo pyxdg dateutil
6363 ];
64646565 makeWrapperArgs = [
+9-6
pkgs/build-support/docker/default.nix
···234234 # Files to add to the layer.
235235 contents ? null,
236236 # Additional commands to run on the layer before it is tar'd up.
237237- extraCommands ? ""
237237+ extraCommands ? "", uid ? 0, gid ? 0
238238 }:
239239 runCommand "docker-layer-${name}" {
240240 inherit baseJson contents extraCommands;
241241-242241 buildInputs = [ jshon rsync ];
243242 }
244243 ''
···253252 echo "No contents to add to layer."
254253 fi
255254255255+ chmod ug+w layer
256256+256257 if [[ -n $extraCommands ]]; then
257258 (cd layer; eval "$extraCommands")
258259 fi
···260261 # Tar up the layer and throw it into 'layer.tar'.
261262 echo "Packing layer..."
262263 mkdir $out
263263- tar -C layer --mtime="@$SOURCE_DATE_EPOCH" -cf $out/layer.tar .
264264+ tar -C layer --mtime="@$SOURCE_DATE_EPOCH" --owner=${toString uid} --group=${toString gid} -cf $out/layer.tar .
264265265266 # Compute a checksum of the tarball.
266267 echo "Computing layer checksum..."
···312313 echo "Adding $item..."
313314 rsync -ak --chown=0:0 $item/ layer/
314315 done
316316+317317+ chmod ug+w layer
315318 '';
316319317320 postMount = ''
···375378 # Docker config; e.g. what command to run on the container.
376379 config ? null,
377380 # Optional bash script to run on the files prior to fixturizing the layer.
378378- extraCommands ? "",
381381+ extraCommands ? "", uid ? 0, gid ? 0,
379382 # Optional bash script to run as root on the image when provisioning.
380383 runAsRoot ? null,
381384 # Size of the virtual machine disk to provision when building the image.
···398401 if runAsRoot == null
399402 then mkPureLayer {
400403 name = baseName;
401401- inherit baseJson contents extraCommands;
404404+ inherit baseJson contents extraCommands uid gid;
402405 } else mkRootLayer {
403406 name = baseName;
404407 inherit baseJson fromImage fromImageName fromImageTag
···498501 chmod -R a-w image
499502500503 echo "Cooking the image..."
501501- tar -C image --mtime="@$SOURCE_DATE_EPOCH" -c . | pigz -nT > $out
504504+ tar -C image --mtime="@$SOURCE_DATE_EPOCH" --owner=0 --group=0 -c . | pigz -nT > $out
502505503506 echo "Finished."
504507 '';
···5656 mkDerivation = pkgs.makeOverridable builder;
5757 };
58585959+ /* Uses generic-builder to evaluate provided drv containing Elixir version
6060+ specific data.
6161+6262+ drv: package containing version-specific args;
6363+ builder: generic builder for all Erlang versions;
6464+ args: arguments merged into version-specific args, used mostly to customize
6565+ dependencies;
6666+6767+ Arguments passed to the generic-builder are overridable.
6868+6969+ Please note that "mkDerivation" defined here is the one called from 1.2.nix
7070+ and similar files.
7171+ */
7272+ callLFE = drv: args:
7373+ let
7474+ inherit (stdenv.lib) versionAtLeast;
7575+ builder = callPackage ../interpreters/lfe/generic-builder.nix args;
7676+ in
7777+ callPackage drv {
7878+ mkDerivation = pkgs.makeOverridable builder;
7979+ };
8080+5981}
···302302 CIFS_UPCALL y
303303 CIFS_ACL y
304304 CIFS_DFS_UPCALL y
305305- CIFS_SMB2 y
305305+ ${optionalString (versionOlder version "4.13") ''
306306+ CIFS_SMB2 y
307307+ ''}
306308 ${optionalString (versionAtLeast version "3.12") ''
307309 CEPH_FSCACHE y
308310 ''}
···11-From 8a937a25a7e3c19d5fb3f9d92f605cf5fda219d8 Mon Sep 17 00:00:00 2001
22-From: Masami Hiramatsu <mhiramat@kernel.org>
33-Date: Wed, 4 Jan 2017 12:30:19 +0900
44-Subject: perf probe: Fix to probe on gcc generated symbols for offline kernel
55-66-From: Masami Hiramatsu <mhiramat@kernel.org>
77-88-commit 8a937a25a7e3c19d5fb3f9d92f605cf5fda219d8 upstream.
99-1010-Fix perf-probe to show probe definition on gcc generated symbols for
1111-offline kernel (including cross-arch kernel image).
1212-1313-gcc sometimes optimizes functions and generate new symbols with suffixes
1414-such as ".constprop.N" or ".isra.N" etc. Since those symbol names are
1515-not recorded in DWARF, we have to find correct generated symbols from
1616-offline ELF binary to probe on it (kallsyms doesn't correct it). For
1717-online kernel or uprobes we don't need it because those are rebased on
1818-_text, or a section relative address.
1919-2020-E.g. Without this:
2121-2222- $ perf probe -k build-arm/vmlinux -F __slab_alloc*
2323- __slab_alloc.constprop.9
2424- $ perf probe -k build-arm/vmlinux -D __slab_alloc
2525- p:probe/__slab_alloc __slab_alloc+0
2626-2727-If you put above definition on target machine, it should fail
2828-because there is no __slab_alloc in kallsyms.
2929-3030-With this fix, perf probe shows correct probe definition on
3131-__slab_alloc.constprop.9:
3232-3333- $ perf probe -k build-arm/vmlinux -D __slab_alloc
3434- p:probe/__slab_alloc __slab_alloc.constprop.9+0
3535-3636-Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
3737-Cc: Jiri Olsa <jolsa@redhat.com>
3838-Cc: Namhyung Kim <namhyung@kernel.org>
3939-Cc: Peter Zijlstra <peterz@infradead.org>
4040-Link: http://lkml.kernel.org/r/148350060434.19001.11864836288580083501.stgit@devbox
4141-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
4242-Cc: Krister Johansen <kjlx@templeofstupid.com>
4343-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4444-4545----
4646- tools/perf/util/probe-event.c | 48 +++++++++++++++++++++++++++++++++++++++++-
4747- 1 file changed, 47 insertions(+), 1 deletion(-)
4848-4949---- a/tools/perf/util/probe-event.c
5050-+++ b/tools/perf/util/probe-event.c
5151-@@ -618,6 +618,51 @@ error:
5252- return ret ? : -ENOENT;
5353- }
5454-5555-+/*
5656-+ * Rename DWARF symbols to ELF symbols -- gcc sometimes optimizes functions
5757-+ * and generate new symbols with suffixes such as .constprop.N or .isra.N
5858-+ * etc. Since those symbols are not recorded in DWARF, we have to find
5959-+ * correct generated symbols from offline ELF binary.
6060-+ * For online kernel or uprobes we don't need this because those are
6161-+ * rebased on _text, or already a section relative address.
6262-+ */
6363-+static int
6464-+post_process_offline_probe_trace_events(struct probe_trace_event *tevs,
6565-+ int ntevs, const char *pathname)
6666-+{
6767-+ struct symbol *sym;
6868-+ struct map *map;
6969-+ unsigned long stext = 0;
7070-+ u64 addr;
7171-+ int i;
7272-+
7373-+ /* Prepare a map for offline binary */
7474-+ map = dso__new_map(pathname);
7575-+ if (!map || get_text_start_address(pathname, &stext) < 0) {
7676-+ pr_warning("Failed to get ELF symbols for %s\n", pathname);
7777-+ return -EINVAL;
7878-+ }
7979-+
8080-+ for (i = 0; i < ntevs; i++) {
8181-+ addr = tevs[i].point.address + tevs[i].point.offset - stext;
8282-+ sym = map__find_symbol(map, addr);
8383-+ if (!sym)
8484-+ continue;
8585-+ if (!strcmp(sym->name, tevs[i].point.symbol))
8686-+ continue;
8787-+ /* If we have no realname, use symbol for it */
8888-+ if (!tevs[i].point.realname)
8989-+ tevs[i].point.realname = tevs[i].point.symbol;
9090-+ else
9191-+ free(tevs[i].point.symbol);
9292-+ tevs[i].point.symbol = strdup(sym->name);
9393-+ tevs[i].point.offset = addr - sym->start;
9494-+ }
9595-+ map__put(map);
9696-+
9797-+ return 0;
9898-+}
9999-+
100100- static int add_exec_to_probe_trace_events(struct probe_trace_event *tevs,
101101- int ntevs, const char *exec)
102102- {
103103-@@ -694,7 +739,8 @@ post_process_kernel_probe_trace_events(s
104104-105105- /* Skip post process if the target is an offline kernel */
106106- if (symbol_conf.ignore_vmlinux_buildid)
107107-- return 0;
108108-+ return post_process_offline_probe_trace_events(tevs, ntevs,
109109-+ symbol_conf.vmlinux_name);
110110-111111- reloc_sym = kernel_get_ref_reloc_sym();
112112- if (!reloc_sym) {
113113-114114----
115115-116116-From 3e96dac7c956089d3f23aca98c4dfca57b6aaf8a Mon Sep 17 00:00:00 2001
117117-From: Masami Hiramatsu <mhiramat@kernel.org>
118118-Date: Wed, 11 Jan 2017 15:00:47 +0900
119119-Subject: perf probe: Add error checks to offline probe post-processing
120120-121121-From: Masami Hiramatsu <mhiramat@kernel.org>
122122-123123-commit 3e96dac7c956089d3f23aca98c4dfca57b6aaf8a upstream.
124124-125125-Add error check codes on post processing and improve it for offline
126126-probe events as:
127127-128128- - post processing fails if no matched symbol found in map(-ENOENT)
129129- or strdup() failed(-ENOMEM).
130130-131131- - Even if the symbol name is the same, it updates symbol address
132132- and offset.
133133-134134-Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
135135-Cc: Jiri Olsa <jolsa@redhat.com>
136136-Cc: Namhyung Kim <namhyung@kernel.org>
137137-Cc: Peter Zijlstra <peterz@infradead.org>
138138-Link: http://lkml.kernel.org/r/148411443738.9978.4617979132625405545.stgit@devbox
139139-Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
140140-Cc: Krister Johansen <kjlx@templeofstupid.com>
141141-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
142142-143143----
144144- tools/perf/util/probe-event.c | 50 +++++++++++++++++++++++++++---------------
145145- 1 file changed, 33 insertions(+), 17 deletions(-)
146146-147147---- a/tools/perf/util/probe-event.c
148148-+++ b/tools/perf/util/probe-event.c
149149-@@ -618,6 +618,33 @@ error:
150150- return ret ? : -ENOENT;
151151- }
152152-153153-+/* Adjust symbol name and address */
154154-+static int post_process_probe_trace_point(struct probe_trace_point *tp,
155155-+ struct map *map, unsigned long offs)
156156-+{
157157-+ struct symbol *sym;
158158-+ u64 addr = tp->address + tp->offset - offs;
159159-+
160160-+ sym = map__find_symbol(map, addr);
161161-+ if (!sym)
162162-+ return -ENOENT;
163163-+
164164-+ if (strcmp(sym->name, tp->symbol)) {
165165-+ /* If we have no realname, use symbol for it */
166166-+ if (!tp->realname)
167167-+ tp->realname = tp->symbol;
168168-+ else
169169-+ free(tp->symbol);
170170-+ tp->symbol = strdup(sym->name);
171171-+ if (!tp->symbol)
172172-+ return -ENOMEM;
173173-+ }
174174-+ tp->offset = addr - sym->start;
175175-+ tp->address -= offs;
176176-+
177177-+ return 0;
178178-+}
179179-+
180180- /*
181181- * Rename DWARF symbols to ELF symbols -- gcc sometimes optimizes functions
182182- * and generate new symbols with suffixes such as .constprop.N or .isra.N
183183-@@ -630,11 +657,9 @@ static int
184184- post_process_offline_probe_trace_events(struct probe_trace_event *tevs,
185185- int ntevs, const char *pathname)
186186- {
187187-- struct symbol *sym;
188188- struct map *map;
189189- unsigned long stext = 0;
190190-- u64 addr;
191191-- int i;
192192-+ int i, ret = 0;
193193-194194- /* Prepare a map for offline binary */
195195- map = dso__new_map(pathname);
196196-@@ -644,23 +669,14 @@ post_process_offline_probe_trace_events(
197197- }
198198-199199- for (i = 0; i < ntevs; i++) {
200200-- addr = tevs[i].point.address + tevs[i].point.offset - stext;
201201-- sym = map__find_symbol(map, addr);
202202-- if (!sym)
203203-- continue;
204204-- if (!strcmp(sym->name, tevs[i].point.symbol))
205205-- continue;
206206-- /* If we have no realname, use symbol for it */
207207-- if (!tevs[i].point.realname)
208208-- tevs[i].point.realname = tevs[i].point.symbol;
209209-- else
210210-- free(tevs[i].point.symbol);
211211-- tevs[i].point.symbol = strdup(sym->name);
212212-- tevs[i].point.offset = addr - sym->start;
213213-+ ret = post_process_probe_trace_point(&tevs[i].point,
214214-+ map, stext);
215215-+ if (ret < 0)
216216-+ break;
217217- }
218218- map__put(map);
219219-220220-- return 0;
221221-+ return ret;
222222- }
223223-224224- static int add_exec_to_probe_trace_events(struct probe_trace_event *tevs,
···6262 assert buildKernel -> kernel != null;
6363 {
6464 splStable = common {
6565- version = "0.6.5.10";
6666- sha256 = "1zdxggpdz9j0lpcqfnkvf4iym7mp2k246sg1s4frqaw1pwwcw9vi";
6565+ version = "0.6.5.11";
6666+ sha256 = "192val8035pj2rryi3fwb134avzirhv5ifaj5021vh8bbjx75pd5";
6767 };
6868 splUnstable = common {
6969- version = "0.7.0-rc4";
7070- sha256 = "13r5qwrdnaabqfy9fvizvdj4n4cvfv6zy4jh0vijzjvbjd4an9g1";
6969+ version = "0.7.0-rc5";
7070+ sha256 = "17y25g02c9swi3n90lhjvazcnsr69nh50dz3b8g1c08zlz9n2akp";
7171 };
7272 }
+5-5
pkgs/os-specific/linux/zfs/default.nix
···123123 # to be adapted
124124 zfsStable = common {
125125 # comment/uncomment if breaking kernel versions are known
126126- incompatibleKernelVersion = null;
126126+ incompatibleKernelVersion = "4.12";
127127128128- version = "0.6.5.10";
128128+ version = "0.6.5.11";
129129130130 # this package should point to the latest release.
131131- sha256 = "04gn5fj22z17zq2nazxwl3j9dr33l79clha6ipxvdz241bhjqrk3";
131131+ sha256 = "1wqz43cjr21m3f52ahcikl2798pbzj5sfy16zqxwiqpv7iy09kr3";
132132 extraPatches = [
133133 (fetchpatch {
134134 url = "https://github.com/Mic92/zfs/compare/zfs-0.6.5.8...nixos-zfs-0.6.5.8.patch";
···141141 # comment/uncomment if breaking kernel versions are known
142142 incompatibleKernelVersion = "4.12";
143143144144- version = "0.7.0-rc4";
144144+ version = "0.7.0-rc5";
145145146146 # this package should point to a version / git revision compatible with the latest kernel release
147147- sha256 = "16jiq2h7m2ljg5xv7m5lqmsszzclkhvj1iq1wa9w740la4vl22kf";
147147+ sha256 = "1k0fl6lbi5winri58v26k7gngd560hbj0247rnwcbc6j01ixsr5n";
148148 extraPatches = [
149149 (fetchpatch {
150150 url = "https://github.com/Mic92/zfs/compare/zfs-0.7.0-rc3...nixos-zfs-0.7.0-rc3.patch";