From owner-freebsd-hackers@freebsd.org Fri Dec 28 19:31:20 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE3AD1420066 for ; Fri, 28 Dec 2018 19:31:20 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B50A97118 for ; Fri, 28 Dec 2018 19:31:18 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: by mail-ed1-x52e.google.com with SMTP id o10so18219983edt.13 for ; Fri, 28 Dec 2018 11:31:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=longcount-org.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=XMihB5MM1r8qOIaDH/V+ctZ6FSRPWOdz6E+wKH2gUJQ=; b=0VMx6kyV+ev8JBsMFGobYiS126B0Gfl1DJAguGol5wtCmeCtaUnx8UIRNXHuBLEC3y d9nK+RdHLwYt+HNtyLmkdreEreeLyTcFZWgEmEgxSDP6CBrASnBEvumfqk/yhd0qdGKH fs1zZrrltf4tlr0VuZQe4o1lka++WHeKHTITYj3L/Ztwg1Y6+S2rDUl0vyGhP1z+xhOS J9P/uy3PcAzoba90CtcUXSOG71DuU3yg7sWdVNekUF2CHIgMgC9gONhdi+CKa9q8tyjc MuvRkxZktGbzbWuCd6U21N7IjaKVsZKCz9b59Gqc+Bupbdn5EE6HRyd/z0ezlw2PIdkH n4kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=XMihB5MM1r8qOIaDH/V+ctZ6FSRPWOdz6E+wKH2gUJQ=; b=fl8j9ls3Q5/QC9/vmKySAWEOH1HGXV5UaezgYN5zocXv3DD3ozIn9qYbVKSqN6aZeD rORRUtrlA2xi1HE50FDIgfHvdMRHK6UY0NQihcg3tiWy5V4JkhBO99kcVRGr7amyhiPT rWLyZLM4KYnyosJRdhCbVRDbxJtpDqgjy1hFOAf08xlBNL/hxrgoJhB7HOzHrip1XuvZ xyqXBwqHdgKfVdIRoDf7XCpwzYaBKI7KYoox7AiCpLeXngRDOhiBhd7k0HCTjKVBxRGB Lrk4YO1v45R0YYi2KkASDB0LEqpXB+yp4V8rmBTWaKZdB2bSXxjD/JimfgtrpUef3Dea 9PSw== X-Gm-Message-State: AA+aEWYkm/HAkFzBBQH4IGMRSO8MVrfZf1H80vuh7e88H6kxt5o9+Y22 RIDsjIyQpkSrf99ytGEebyYFH+K5+CiBb1Uo64XQqDG6ygk= X-Google-Smtp-Source: AFSGD/UI//P/UfgXUM8DhprXmTIK+lS11uK9i92hBu9/AsHwqgtnWTzXMFvUHUdEQSSWf+Lu6emG0HPZ6weTnBu13cc= X-Received: by 2002:a50:fb03:: with SMTP id d3mr22654413edq.183.1546025477553; Fri, 28 Dec 2018 11:31:17 -0800 (PST) MIME-Version: 1.0 From: Mark Saad Date: Fri, 28 Dec 2018 14:31:10 -0500 Message-ID: Subject: libxo question To: FreeBSD Hackers X-Rspamd-Queue-Id: 1B50A97118 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=longcount-org.20150623.gappssmtp.com header.s=20150623 header.b=0VMx6kyV X-Spamd-Result: default: False [-5.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[longcount-org.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; HAS_ATTACHMENT(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[longcount.org]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-2.41)[ip: (-8.68), ipnet: 2a00:1450::/32(-1.76), asn: 15169(-1.52), country: US(-0.08)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[longcount-org.20150623.gappssmtp.com:+]; MIME_BASE64_TEXT(0.10)[]; RCVD_IN_DNSWL_NONE(0.00)[e.2.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx5.googlemail.com,aspmx4.googlemail.com,aspmx3.googlemail.com,alt2.aspmx.l.google.com,aspmx2.googlemail.com]; R_SPF_NA(0.00)[]; NEURAL_HAM_SHORT(-0.91)[-0.910,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 19:31:21 -0000 All I am playing around with procstat and libxo on 12-STABLE from yesterday . I wanted to get a list of thread_id's for some processes. I wrote a quick python script to grab the data but xml output is not well formed. Here is my sample script , which should work on python 2.7 ----8<----------------------- 1 import subprocess as sp 2 import os,sys 3 import pprint as pp 4 import xml.etree.cElementTree as ET 5 6 7 FNULL = open(os.devnull, 'w') 8 cmd = "procstat --libxo xml -ta" 9 p = sp.Popen(cmd, shell=True, stdout=sp.PIPE,stderr=FNULL, executable="/bin/sh") 10 text , err = p.communicate() 11 12 root = ET.fromstring(text) 13 14 pp.pprint(root) 15 16 sys.exit(1) ------------>8----------------------- I am constantly getting this odd issue about the xml being not well formatted Traceback (most recent call last): File "/tmp/test.py", line 12, in root = ET.fromstring(text) File "", line 124, in XML cElementTree.ParseError: not well-formed (invalid token): line 1, column 32 Attached is a copy of the xml. Any guidance would be helpful. -- mark saad | nonesuch@longcount.org