[Merge] lp:~morphis/aethercast/add-lttng-support into lp:aethercast

Jim Hodapp jim.hodapp at canonical.com
Mon Mar 7 19:39:14 UTC 2016


Review: Needs Fixing code

Looks good Simon. See my comments inline below.

Diff comments:

> 
> === added file 'cmake/FindLTTngUST.cmake'
> --- cmake/FindLTTngUST.cmake	1970-01-01 00:00:00 +0000
> +++ cmake/FindLTTngUST.cmake	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,33 @@
> +# - Try to find LTTng-UST
> +# Once done this will define
> +#  LTTNG_UST_FOUND - System has LTTng-UST
> +#  LTTNG_UST_INCLUDE_DIRS - The LTTng-UST include directories
> +#  LTTNG_UST_LIBRARIES - The libraries needed to use LTTng-UST
> +
> +find_package(PkgConfig)
> +
> +# pkgconfig is currently broken for LTTng-UST and urcu-bp

Does your method work just as well as pkgconfig would for finding LTTng-UST? If so, I say remove the pkg_check_modules() calls below.

> +#pkg_check_modules(PC_LTTNG_UST QUIET lttng-ust)
> +#pkg_check_modules(PC_LIBURCU_BP QUIET liburcu-bp)
> +
> +find_path(LTTNG_UST_INCLUDE_DIR lttng/tracepoint.h
> +          HINTS ${PC_LTTNG_UST_INCLUDEDIR} ${PC_LTTNG_UST_INCLUDE_DIRS})
> +
> +find_library(LTTNG_UST_LIBRARY lttng-ust
> +             HINTS ${PC_LTTNG_UST_LIBDIR} ${PC_LTTNG_UST_LIBRARY_DIRS})
> +
> +find_library(LIBURCU_BP_LIBRARY urcu-bp
> +             HINTS ${PC_LIBURCU_BP_LIBDIR} ${PC_LIBURCU_BP_LIBRARY_DIRS})
> +
> +set(LTTNG_UST_LIBRARIES ${LTTNG_UST_LIBRARY} ${LIBURCU_BP_LIBRARY} -ldl)
> +set(LTTNG_UST_INCLUDE_DIRS ${LTTNG_UST_INCLUDE_DIR})
> +
> +include(FindPackageHandleStandardArgs)
> +# handle the QUIETLY and REQUIRED arguments and set LTTNG_UST_FOUND to TRUE
> +# if all listed variables are TRUE
> +find_package_handle_standard_args(LTTNG_UST DEFAULT_MSG
> +                                  LTTNG_UST_LIBRARY
> +                                  LIBURCU_BP_LIBRARY
> +                                  LTTNG_UST_INCLUDE_DIR)
> +
> +mark_as_advanced(LTTNG_UST_INCLUDE_DIR LTTNG_UST_LIBRARY)
> 
> === added file 'docs/lttng.txt'
> --- docs/lttng.txt	1970-01-01 00:00:00 +0000
> +++ docs/lttng.txt	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,28 @@
> +Tracing with LTTng
> +==================
> +
> +Aethercast has support for LTTng tracepoints for various events. You can
> +record tracepoints from aethercast with the following commands:
> +
> + $ lttng create aethercast-session -o /tmp/aethercast-session
> + $ lttng enable-event -u -a
> + $ lttng start
> + $ AETHERCAST_REPORT_TYPE=lttng aethercast
> + $ lttng stop
> + $ lttng destroy aethercast-session
> +
> +To allow tracepoints to be used at runtime after you have set the
> +AETHERCAST_REPORT_TYPE environment variable you need to make sure
> +the shared library libaethercast-lttng.so is properly installed
> +on your system.
> +
> +On Ubuntu you can archive this by installing the aethercast-tools
> +package:
> +
> + $ apt-get install aethercast-tools
> +
> +You can then analzye the results then with your tool of choice. See

Change to: "You can then analyze the results with your tool of choice."

> +the LTTng homepage at http://lttng.org/ for a list of possible tools

Add a period at the end of the sentence.

> +The easiest way is by using babeltrace.
> +
> + $ babeltrace /tmp/aethercast-session/<trace-subdir>
> 
> === modified file 'src/mcs/mir/sourcemediamanager.cpp'
> --- src/mcs/mir/sourcemediamanager.cpp	2016-03-07 17:06:26 +0000
> +++ src/mcs/mir/sourcemediamanager.cpp	2016-03-07 17:06:26 +0000
> @@ -62,7 +66,7 @@
>      if (!connector_->IsValid())
>          return false;
>  
> -    encoder_ = mcs::android::H264Encoder::Create();
> +    encoder_ = mcs::android::H264Encoder::Create(report_factory->CreateEncoderReport());

It feels a little strange to me to have the H264Encoder, StreamRenderer and RTPSender classes directly take a report instance as part of its creation. Could you create a generic Reportable interface that all of these classes would implement? Then you could have a method that each would contain such as H264Encoder::SetReport(report_factory->CreateEncoderReport());

>  
>      int profile = 0, level = 0, constraint = 0;
>      mcs::video::ExtractProfileLevel(format_, &profile, &level, &constraint);
> 
> === added file 'src/mcs/report/logging/rendererreport.cpp'
> --- src/mcs/report/logging/rendererreport.cpp	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/logging/rendererreport.cpp	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,35 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#include "mcs/logger.h"
> +
> +#include "mcs/report/logging/rendererreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace logging {
> +
> +void RendererReport::BeganFrame() {
> +}
> +
> +void RendererReport::FinishedFrame(const TimestampUs timestamp) {

Pass by reference as Konrad said.

> +    MCS_TRACE("timestamp %lld", timestamp);
> +}
> +
> +} // namespace logging
> +} // namespace report
> +} // namespace mcs
> 
> === added file 'src/mcs/report/logging/rendererreport.h'
> --- src/mcs/report/logging/rendererreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/logging/rendererreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,42 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_REPORT_LOGGING_RENDERERREPORT_H_
> +#define MCS_REPORT_LOGGING_RENDERERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +#include "mcs/utils.h"
> +
> +#include "mcs/video/rendererreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace logging {
> +
> +class RendererReport : public video::RendererReport {
> +public:
> +     void BeganFrame();
> +     void FinishedFrame(const mcs::TimestampUs timestamp);

Pass by reference.

> +};
> +
> +} // namespace logging
> +} // namespace report
> +} // namespace mcs
> +
> +#endif
> 
> === added directory 'src/mcs/report/lttng'
> === added file 'src/mcs/report/lttng/encoderreport.cpp'
> --- src/mcs/report/lttng/encoderreport.cpp	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/lttng/encoderreport.cpp	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,50 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#include "mcs/report/lttng/encoderreport.h"
> +
> +#define TRACEPOINT_DEFINE
> +#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
> +#include "mcs/report/lttng/encoderreport_tp.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace lttng {
> +
> +void EncoderReport::Started() {
> +    mcs_tracepoint(aethercast_encoder, started, 0);
> +}
> +
> +void EncoderReport::Stopped() {
> +    mcs_tracepoint(aethercast_encoder, stopped, 0);
> +}
> +
> +void EncoderReport::BeganFrame(const mcs::TimestampUs timestamp) {

Pass by reference.

> +    mcs_tracepoint(aethercast_encoder, began_frame, timestamp);
> +}
> +
> +void EncoderReport::FinishedFrame(const mcs::TimestampUs timestamp) {

Pass by reference.

> +    mcs_tracepoint(aethercast_encoder, finished_frame, timestamp);
> +}
> +
> +void EncoderReport::ReceivedInputBuffer(const mcs::TimestampUs timestamp) {

Pass by reference.

> +    mcs_tracepoint(aethercast_encoder, received_input_buffer, timestamp);
> +}
> +
> +} // namespace logging
> +} // namespace report
> +} // namespace mcs
> 
> === added file 'src/mcs/report/lttng/encoderreport.h'
> --- src/mcs/report/lttng/encoderreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/lttng/encoderreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,49 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_REPORT_LTTNG_ENCODERREPORT_H_
> +#define MCS_REPORT_LTTNG_ENCODERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +
> +#include "mcs/video/encoderreport.h"
> +
> +#include "mcs/report/lttng/tracepointprovider.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace lttng {
> +
> +class EncoderReport : public video::EncoderReport {
> +public:
> +    void Started();
> +    void Stopped();
> +    void BeganFrame(const mcs::TimestampUs timestamp);

Pass by reference.

> +    void FinishedFrame(const mcs::TimestampUs timestamp);

Pass by reference.

> +    void ReceivedInputBuffer(const mcs::TimestampUs timestamp);

Pass by reference.

> +
> +private:
> +    TracepointProvider tp_;
> +};
> +
> +} // namespace lttng
> +} // namespace report
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/report/lttng/packetizerreport.cpp'
> --- src/mcs/report/lttng/packetizerreport.cpp	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/lttng/packetizerreport.cpp	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#include "mcs/report/lttng/packetizerreport.h"
> +
> +#define TRACEPOINT_DEFINE
> +#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
> +#include "mcs/report/lttng/packetizerreport_tp.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace lttng {
> +
> +void PacketizerReport::PacketizedFrame(const TimestampUs timestamp) {

Pass by reference.

> +    mcs_tracepoint(aethercast_packetizer, packetized_frame, timestamp);
> +}
> +
> +} // namespace lttng
> +} // namespace report
> +} // namespace mcs
> 
> === added file 'src/mcs/report/lttng/packetizerreport.h'
> --- src/mcs/report/lttng/packetizerreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/lttng/packetizerreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,41 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_REPORT_LTTNG_PACKETIZERREPORT_H_
> +#define MCS_REPORT_LTTNG_PACKETIZERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +#include "mcs/utils.h"
> +
> +#include "mcs/video/packetizerreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace lttng {
> +
> +class PacketizerReport : public video::PacketizerReport {
> +public:
> +     void PacketizedFrame(const mcs::TimestampUs timestamp);

Pass by reference.

> +};
> +
> +} // namespace lttng
> +} // namespace report
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/report/lttng/rendererreport.cpp'
> --- src/mcs/report/lttng/rendererreport.cpp	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/lttng/rendererreport.cpp	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,38 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#include "mcs/report/lttng/rendererreport.h"
> +
> +#define TRACEPOINT_DEFINE
> +#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
> +#include "mcs/report/lttng/rendererreport_tp.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace lttng {
> +
> +void RendererReport::BeganFrame() {
> +    mcs_tracepoint(aethercast_renderer, began_frame, 0);
> +}
> +
> +void RendererReport::FinishedFrame(const TimestampUs timestamp) {

Pass by reference.

> +    mcs_tracepoint(aethercast_renderer, finished_frame, timestamp);
> +}
> +
> +} // namespace lttng
> +} // namespace report
> +} // namespace mcs
> 
> === added file 'src/mcs/report/lttng/rendererreport.h'
> --- src/mcs/report/lttng/rendererreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/lttng/rendererreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,42 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_REPORT_LTTNG_RENDERERREPORT_H_
> +#define MCS_REPORT_LTTNG_RENDERERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +#include "mcs/utils.h"
> +
> +#include "mcs/video/rendererreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace lttng {
> +
> +class RendererReport : public video::RendererReport {
> +public:
> +     void BeganFrame();
> +     void FinishedFrame(const mcs::TimestampUs timestamp);

Pass by reference.

> +};
> +
> +} // namespace lttng
> +} // namespace report
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/report/lttng/senderreport.cpp'
> --- src/mcs/report/lttng/senderreport.cpp	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/lttng/senderreport.cpp	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,34 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#include "mcs/report/lttng/senderreport.h"
> +
> +#define TRACEPOINT_DEFINE
> +#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
> +#include "mcs/report/lttng/senderreport_tp.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace lttng {
> +
> +void SenderReport::SentPacket(const TimestampUs timestamp, size_t size) {

Pass timestamp by reference.

> +    mcs_tracepoint(aethercast_sender, sent_packet, timestamp, size);
> +}
> +
> +} // namespace lttng
> +} // namespace report
> +} // namespace mcs
> 
> === added file 'src/mcs/report/lttng/senderreport.h'
> --- src/mcs/report/lttng/senderreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/lttng/senderreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,41 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_REPORT_LTTNG_SENDERREPORT_H_
> +#define MCS_REPORT_LTTNG_SENDERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +#include "mcs/utils.h"
> +
> +#include "mcs/video/senderreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace lttng {
> +
> +class SenderReport : public video::SenderReport {
> +public:
> +    void SentPacket(const mcs::TimestampUs timestamp, size_t size);

Pass timestamp by reference.

> +};
> +
> +} // namespace lttng
> +} // namespace report
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/report/lttng/tracepointprovider.cpp'
> --- src/mcs/report/lttng/tracepointprovider.cpp	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/lttng/tracepointprovider.cpp	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,61 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#include <dlfcn.h>
> +
> +#include <boost/throw_exception.hpp>
> +
> +#include "mcs/report/lttng/tracepointprovider.h"
> +
> +namespace
> +{
> +static const std::string kTracepointLibInstallPath{AETHERCAST_TRACEPOINT_LIB_INSTALL_PATH};
> +static const std::string kAethercastTpProviderLibName{"libaethercast-lttng.so"};
> +
> +void* OpenTracepointLib(std::string const& lib_name) {
> +    auto lib = dlopen(lib_name.c_str(), RTLD_NOW);

You should set lib_ at some point, or use it instead of just lib for this entire function. Otherwise dlclose(lib_) won't actually close anything.

> +
> +    if (!lib) {
> +        std::string path{kTracepointLibInstallPath + "/" + lib_name};

const

> +        lib = dlopen(path.c_str(), RTLD_NOW);
> +    }
> +
> +    if (!lib) {
> +        std::string msg{"Failed to load tracepoint provider: "};
> +        msg += dlerror();
> +        BOOST_THROW_EXCEPTION(std::runtime_error(msg));

What does BOOST_THROW_EXCEPTION give that the normal exception throw doesn't?

> +    }
> +
> +    return lib;
> +}
> +}
> +
> +namespace mcs {
> +namespace report {
> +namespace lttng {
> +
> +TracepointProvider::TracepointProvider() :
> +    lib_(OpenTracepointLib(kAethercastTpProviderLibName)) {
> +}
> +
> +TracepointProvider::~TracepointProvider() {
> +    dlclose(lib_);
> +}
> +
> +} // namespace lttng
> +} // namespace report
> +} // namespace mcs
> 
> === added file 'src/mcs/report/null/encoderreport.h'
> --- src/mcs/report/null/encoderreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/null/encoderreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_REPORT_NULL_ENCODERREPORT_H_
> +#define MCS_REPORT_NULL_ENCODERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +
> +#include "mcs/video/encoderreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace null {
> +
> +class EncoderReport : public video::EncoderReport {
> +public:
> +    void Started();
> +    void Stopped();
> +    void BeganFrame(const mcs::TimestampUs timestamp);

Pass by reference (same for the next 2).

> +    void FinishedFrame(const mcs::TimestampUs timestamp);
> +    void ReceivedInputBuffer(const mcs::TimestampUs timestamp);
> +};
> +
> +} // namespace null
> +} // namespace report
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/report/null/packetizerreport.cpp'
> --- src/mcs/report/null/packetizerreport.cpp	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/null/packetizerreport.cpp	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,29 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#include "mcs/report/null/packetizerreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace null {
> +
> +void PacketizerReport::PacketizedFrame(const TimestampUs timestamp) {

Pass by reference.

> +}
> +
> +} // namespace null
> +} // namespace report
> +} // namespace mcs
> 
> === added file 'src/mcs/report/null/packetizerreport.h'
> --- src/mcs/report/null/packetizerreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/null/packetizerreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,41 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_REPORT_NULL_PACKETIZERREPORT_H_
> +#define MCS_REPORT_NULL_PACKETIZERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +#include "mcs/utils.h"
> +
> +#include "mcs/video/packetizerreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace null {
> +
> +class PacketizerReport : public video::PacketizerReport {
> +public:
> +     void PacketizedFrame(const mcs::TimestampUs timestamp);

Pass by reference.

> +};
> +
> +} // namespace null
> +} // namespace report
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/report/null/rendererreport.cpp'
> --- src/mcs/report/null/rendererreport.cpp	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/null/rendererreport.cpp	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,32 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#include "mcs/report/null/rendererreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace null {
> +
> +void RendererReport::BeganFrame() {
> +}
> +
> +void RendererReport::FinishedFrame(const TimestampUs timestamp) {

Pass by reference.

> +}
> +
> +} // namespace null
> +} // namespace report
> +} // namespace mcs
> 
> === added file 'src/mcs/report/null/rendererreport.h'
> --- src/mcs/report/null/rendererreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/null/rendererreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,42 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_REPORT_NULL_RENDERERREPORT_H_
> +#define MCS_REPORT_NULL_RENDERERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +#include "mcs/utils.h"
> +
> +#include "mcs/video/rendererreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace null {
> +
> +class RendererReport : public video::RendererReport {
> +public:
> +     void BeganFrame();
> +     void FinishedFrame(const mcs::TimestampUs timestamp);

Pass by reference.

> +};
> +
> +} // namespace null
> +} // namespace report
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/report/null/senderreport.cpp'
> --- src/mcs/report/null/senderreport.cpp	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/null/senderreport.cpp	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,31 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#include "mcs/logger.h"
> +
> +#include "mcs/report/null/senderreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace null {
> +
> +void SenderReport::SentPacket(const TimestampUs timestamp, size_t size) {

Pass timestamp by reference.

> +}
> +
> +} // namespace null
> +} // namespace report
> +} // namespace mcs
> 
> === added file 'src/mcs/report/null/senderreport.h'
> --- src/mcs/report/null/senderreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/null/senderreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,41 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_REPORT_NULL_SENDERREPORT_H_
> +#define MCS_REPORT_NULL_SENDERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +#include "mcs/utils.h"
> +
> +#include "mcs/video/senderreport.h"
> +
> +namespace mcs {
> +namespace report {
> +namespace null {
> +
> +class SenderReport : public video::SenderReport {
> +public:
> +    void SentPacket(const mcs::TimestampUs timestamp, size_t size);

Pass timestamp by reference.

> +};
> +
> +} // namespace null
> +} // namespace report
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/report/reportfactory.cpp'
> --- src/mcs/report/reportfactory.cpp	1970-01-01 00:00:00 +0000
> +++ src/mcs/report/reportfactory.cpp	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,40 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#include "mcs/utils.h"
> +
> +#include "mcs/report/reportfactory.h"
> +#include "mcs/report/null/nullreportfactory.h"
> +#include "mcs/report/logging/loggingreportfactory.h"
> +#include "mcs/report/lttng/lttngreportfactory.h"
> +
> +namespace mcs {
> +namespace report {
> +
> +std::unique_ptr<ReportFactory> ReportFactory::Create() {
> +    std::string type = mcs::Utils::GetEnvValue("AETHERCAST_REPORT_TYPE");

const

> +
> +    if (type == "log")
> +        return std::make_unique<LoggingReportFactory>();
> +    else if (type == "lttng")
> +        return std::make_unique<LttngReportFactory>();
> +
> +    return std::make_unique<NullReportFactory>();
> +}
> +
> +} // namespace report
> +} // namespace mcs
> 
> === added file 'src/mcs/video/encoderreport.h'
> --- src/mcs/video/encoderreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/video/encoderreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,44 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_VIDEO_ENCODERREPORT_H_
> +#define MCS_VIDEO_ENCODERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +
> +#include "mcs/utils.h"
> +
> +namespace mcs {
> +namespace video {
> +
> +class EncoderReport : public mcs::NonCopyable {
> +public:
> +    typedef std::shared_ptr<EncoderReport> Ptr;
> +
> +    virtual void Started() = 0;
> +    virtual void Stopped() = 0;
> +    virtual void BeganFrame(const mcs::TimestampUs timestamp) = 0;

Pass by reference (same for next 2).

> +    virtual void FinishedFrame(const mcs::TimestampUs timestamp) = 0;
> +    virtual void ReceivedInputBuffer(const mcs::TimestampUs timestamp) = 0;
> +};
> +
> +} // namespace video
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/video/packetizerreport.h'
> --- src/mcs/video/packetizerreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/video/packetizerreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,40 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_VIDEO_PACKETIZERREPORT_H_
> +#define MCS_VIDEO_PACKETIZERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +
> +#include "mcs/utils.h"
> +
> +namespace mcs {
> +namespace video {
> +
> +class PacketizerReport : public mcs::NonCopyable {
> +public:
> +    typedef std::shared_ptr<PacketizerReport> Ptr;
> +
> +    virtual void PacketizedFrame(const mcs::TimestampUs timestamp) = 0;

Pass by reference.

> +};
> +
> +} // namespace video
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/video/rendererreport.h'
> --- src/mcs/video/rendererreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/video/rendererreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,41 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_VIDEO_RENDERERREPORT_H_
> +#define MCS_VIDEO_RENDERERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +
> +#include "mcs/utils.h"
> +
> +namespace mcs {
> +namespace video {
> +
> +class RendererReport : public mcs::NonCopyable {
> +public:
> +    typedef std::shared_ptr<RendererReport> Ptr;
> +
> +    virtual void BeganFrame() = 0;
> +    virtual void FinishedFrame(const mcs::TimestampUs timestamp) = 0;

Pass by reference.

> +};
> +
> +} // namespace video
> +} // namespace mcs
> +
> +#endif
> 
> === added file 'src/mcs/video/senderreport.h'
> --- src/mcs/video/senderreport.h	1970-01-01 00:00:00 +0000
> +++ src/mcs/video/senderreport.h	2016-03-07 17:06:26 +0000
> @@ -0,0 +1,40 @@
> +/*
> + * Copyright (C) 2016 Canonical, Ltd.
> + *
> + * This program is free software: you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 3, as published
> + * by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranties of
> + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
> + * PURPOSE.  See the GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */
> +
> +#ifndef MCS_VIDEO_SENDERREPORT_H_
> +#define MCS_VIDEO_SENDERREPORT_H_
> +
> +#include <memory>
> +
> +#include "mcs/non_copyable.h"
> +
> +#include "mcs/utils.h"
> +
> +namespace mcs {
> +namespace video {
> +
> +class SenderReport : public mcs::NonCopyable {
> +public:
> +    typedef std::shared_ptr<SenderReport> Ptr;
> +
> +    virtual void SentPacket(const mcs::TimestampUs timestamp, size_t size) = 0;

Pass timestamp by reference.

> +};
> +
> +} // namespace video
> +} // namespace mcs
> +
> +#endif


-- 
https://code.launchpad.net/~morphis/aethercast/add-lttng-support/+merge/288291
Your team Ubuntu Phablet Team is requested to review the proposed merge of lp:~morphis/aethercast/add-lttng-support into lp:aethercast.



More information about the Ubuntu-reviews mailing list